« MACOSX » : différence entre les versions

 
(88 versions intermédiaires par le même utilisateur non affichées)
Ligne 119 : Ligne 119 :
</pre>
</pre>
   
   
* PHP
* MySql
brew services restart php72
 
avec PHP 5.6
* https://www.sminrana.com/php/install-php-5-6-on-macos-catalina/
* php@5.6 Library not loaded libicui18n.64.dylib https://github.com/eXolnet/homebrew-deprecated/issues/23
<pre>
<pre>
These steps worked on my Mac, Catalina version 10.15.3 (19D76).
brew services restart mariadb
si il y a de nombreuses bases et de tables il faut augmenter limit.maxfiles du mac
verifier avec
$ ulimit -n
et
$ ulimit -u


Step 1: Tap deprecated brew formula
- create /Library/LaunchDaemons/limit.maxfiles.plist


brew tap exolnet/homebrew-deprecated
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>524288</string>
      <string>524288</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>


Step 2: Install PHP 5.6
- create /Library/LaunchDaemons/limit.maxproc.plist


brew install php@5.6
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
      <string>limit.maxproc</string>
    <key>ProgramArguments</key>
      <array>
        <string>launchctl</string>
        <string>limit</string>
        <string>maxproc</string>
        <string>2048</string>
        <string>2048</string>
      </array>
    <key>RunAtLoad</key>
      <true />
    <key>ServiceIPC</key>
      <false />
  </dict>
</plist>
</pre>
* PHP
brew services restart php72
brew services restart php@5.6
* avec PHP 5.6
<nowiki>
These steps worked on my Mac, Catalina version 10.15.3 (19D76).


You can also have PHP 7.2 just run
Step 1: Tap deprecated brew formula
brew tap exolnet/homebrew-deprecated


brew install php@7.2
Step 2: Install PHP 5.6
brew install php@5.6


Step 3: Install PHP switcher script to switch between 5.6 and 7.2
You can also have PHP 7.2 just run
brew install php@7.2


$ curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp
Step 3: Install PHP switcher script to switch between 5.6 and 7.2
$ chmod +x /usr/local/bin/sphp


If you run sphp 7.2 it should work but running sphp 5.6 will not work and will show error like this from apache.
$ curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp  
$ chmod +x /usr/local/bin/sphp


Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylibn  Referenced from: /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.son  Reason: image not found
If you run sphp 7.2 it should work but running sphp 5.6 will not work and will show error like this from apache.
Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylibn  Referenced from: /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.son  Reason: image not found
Unless we switch openssl version, it wont work. So we have to install old openssl


Unless we switch openssl version, it wont work. So we have to install old openssl
Step 4: Install old openssl
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb


Step 4: Install old openssl
Step 5: Switch to openssl 1.0
brew switch openssl 1.0.2t


brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Now you switch to PHP 5.6 by
sphp 5.6


Step 5: Switch to openssl 1.0
Everything works.


brew switch openssl 1.0.2t
! attention appliquer le patch


Now you switch to PHP 5.6 by
</nowiki>
 
sphp 5.6
[https://github.com/eXolnet/homebrew-deprecated/issues/23 PATCH PHP 5.6 Catalina (JParkinson1991 commented)]
 
Everything works.
These open issues may also help:
[https://github.com/eXolnet/homebrew-deprecated/issues/23 php@5.6 Library not loaded libicui18n.64.dylib]
[https://github.com/eXolnet/homebrew-deprecated/issues/19 MacOs,  brew install exolnet/deprecated/php@5.6 errors]
[https://github.com/eXolnet/homebrew-deprecated/issues/14 PHP 5.6 and 7.0 doesn't run on Catalina - openssl 1.0.0 needed]
[https://github.com/eXolnet/homebrew-deprecated/pull/25 Adds optional openssl@1.1 compatability patch for php@5.6.]
 
source:
* https://www.sminrana.com/php/install-php-5-6-on-macos-catalina/


! attention appliquer le patch
* avec PHP-FPM
* https://www.aritsltd.com/blog/server/configuring-apache-with-php7-fpm-on-macos-mojave-using-homebrew/
* https://medium.com/@fahimhossain_16989/configuring-apache-with-php7-fpm-for-mac-os-x-using-homebrew-54a26bbdac7c


</pre>
* Redemarrer php
* https://github.com/eXolnet/homebrew-deprecated/issues/23
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist


== Setup PHP ==
== Setup PHP ==
Ligne 221 : Ligne 284 :
  http://liondiskmaker.com
  http://liondiskmaker.com


[[category:softz]]
== clear DNS cache ==
sudo killall -HUP mDNSResponder; sleep 2;
 
== changer hostname ==
sudo scutil --set HostName "nouveaunom"
sudo scutil --set ComputerName "nouveaunom"
sudo scutil --set LocalHostName "nouveaunom"
* https://www.macplanete.com/astuces/30390/changer-le-nom-de-son-mac
 
 
== Volumes ==
autofs automounter
*[https://useyourloaf.com/blog/using-the-mac-os-x-automounter/ Using the Mac OS X automounter]
=== créer un répertoire de montage ===
<pre>
/Users/user1/Nas/airdisk ou /System/Volumes/Data/Users/user1/Nas/airdisk
/Users/user2/Nas/airdisk2 ou /System/Volumes/Data/Users/user2/Nas/airdisk
</pre>
ls -la
dr-xr-xr-x root wheel mnt
 
=== créer des fichiers de ressources pour automount ===
/etc/auto_airdiskuser1
exemples de partages:
<pre>
Data  -fstype=smbfs ://user:password@nas._smb._tcp.local/Data
photo  -fstype=smbfs ://user:password@nas._smb._tcp.local/photo
video  -fstype=smbfs ://user:password@nas._smb._tcp.local/video
music  -fstype=smbfs ://user:password@nas._smb._tcp.local/music
download  -fstype=smbfs ://user:password@nas._smb._tcp.local/download
</pre>
/etc/auto_airdiskuser2
exemples de partages:
<pre>
Data  -fstype=smbfs ://user:password@nas._smb._tcp.local/Data
toto  -fstype=smbfs ://user:password@nas._smb._tcp.local/toto
</pre>
 
=== modifier le fichier master pour automount ===
/etc/auto_master
Chaque utilisateur a son partage.
<pre>
#
# Automounter master map
#
/System/Volumes/Data/Users/user1/Nas/airdisk auto_airdiskuser1
/System/Volumes/Data/Users/user2/Nas/airdisk auto_airdiskuser2
 
 
+auto_master # Use directory service
#/net -hosts -nobrowse,hidefromfinder,nosuid
/home auto_home -nobrowse,hidefromfinder
/Network/Servers -fstab
/- -static
</pre>
 
=== exécuter les changements ===
sudo automount -vc
=== démonter les volumes ===
sudo umount /Users/user1/Nas/airdisk
 
=== découvrir les options du point de montage ===
mount | grep airdisk
 
=== qu'est ce qui fonctionne ? ===
<pre>
ps -ef | grep automount | grep -v grep
ps -ef | grep autof | grep -v grep
</pre>
=== cd dans le repertoire = montage automatique ===
cd /System/Volumes/Data/Users/user1/Nas/airdisk/Data
df -Ph .
 
== astuces ==
=== désactiver temporairement la mise en veille d'OS X ===
Pour couper provisoirement la veille d'OS X
 
<code>caffeinate -di</code><br>
 
L'ordinateur restera alors en éveil tant que le Terminal sera ouvert, et ni le système ni l'écran n'entreront en mode économie d'énergie. <br>
Pour retrouver un comportement normal, il suffira de fermer le Terminal ou de désactiver la commande à l'aide du raccourci « Control-C ».
 
Si toutefois vous ne souhaitez pas laisser le mode « Caffeinate » indéfiniment, il est possible de définir <br>
à l'avance la durée pendant laquelle l'ordinateur échappera à la veille. Il suffit pour cela d'ajouter à la fin<br>
de la commande précédente le temps (en secondes) pendant lequel cette dernière restera active, et en remplaçant la particule « di » par « dt ».
 
Pour activer le mode « Caffeinate » pendant deux heures, il faudra ainsi saisir la commande suivante dans le Terminal :
 
<code>caffeinate -dt 7200</code>
 
source : [https://www.mackungfu.org/20-classic-mac-tips-and-tricks-you-don-t-know mackungfu.org]
 
[[category:softz]] [[category:MAC]]