[MacPorts] howto/MAMP modified

MacPorts Wiki noreply at macports.org
Wed Apr 12 12:54:06 UTC 2023


Page "howto/MAMP" was changed by cyberon-org
Diff URL: <https://trac.macports.org/wiki/howto/MAMP?action=diff&version=100>
Revision 100
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/MAMP
=========================================================================
--- howto/MAMP (version: 99)
+++ howto/MAMP (version: 100)
@@ -32,8 +32,10 @@
 $ sudo /opt/local/bin/apxs -a -e -n php5 mod_php56.so
 $ # or, if you're using php7...
 $ sudo /opt/local/bin/apxs -a -e -n php7 mod_php74.so
+$ #  and for php8... it's slightly different:
+$ sudo /opt/local/bin/apxs -a -e -n php mod_php82.so
 }}}
-This should return the message:
+This should return a message like:
  ''[activating module `php5' in /opt/local/etc/apache2/httpd.conf]''
 
 
@@ -56,6 +58,8 @@
 Include etc/apache2/extra/mod_php56.conf
 # Or...
 Include etc/apache2/extra/mod_php74.conf
+# Or...
+Include etc/apache2/extra/mod_php82.conf
 }}}
 
 Verify that in the Dynamic Shared Object (DSO) Support  section the following have been added.
@@ -64,6 +68,9 @@
 LoadModule php5_module modules/mod_php56.so
 # Or...
 LoadModule php7_module modules/mod_php74.so
+#
+# And again notice the difference for php82:
+LoadModule php_module  lib/apache2/modules/mod_php82.so
 }}}
 
 Note: either of the above two edits are only required if the lines are not present in the httpd.conf file, as the apxs command (executed above) will add those for you.
@@ -84,12 +91,20 @@
 # mv tmp.ini php.ini
 # exit # OR rm php.ini.bak && exit
 }}}
+
+If you are unfamiliar with multiline Terminal commands like the cat command above: Each line ends with a backslash. Give Enter after the backslash and you will enter the next line.\\
+To make things easy: Copy the first line `cat php.ini | sed \` with Command V and past it in the Terminal with Command C. Hit Enter and copy and paste the next line, etc... \\
+
 The "`grep`" check should return:
 {{{
 pdo_mysql.default_socket=/opt/local/var/run/mysql8/mysqld.sock
 mysql.default_socket=/opt/local/var/run/mysql8/mysqld.sock
 mysqli.default_socket=/opt/local/var/run/mysql8/mysqld.sock
 }}}
+
+For proper setup of MySQL for PHP **all three lines** must be present. If there is one missing, for example mysql.default_socket=/opt/local/var/run/mysql8/mysqld.sock, \\
+Open the php.ini file in your editor and add somewhere the line 'mysql.default_socket='.  Next repeat the cat command above but only for the missing part.\\
+'Grep' should show now the three requires lines. 
 
 Restart Apache so that your changes take effect
 
@@ -101,12 +116,12 @@
 = Step 4: Create phpinfo =
 This is used to test the configuration after you have integrated it with Apache and MySQL.
 
-Create a file named `phpinfo.php` that contains the following line
+Create in Apache's DocumentRoot a file named `phpinfo.php` that contains the following line
 
 {{{
 <?php phpinfo(); ?>
 }}}
-and place it in your Apache "`DocumentRoot`" directory (nominally: "`/opt/local/www/apache2/html`") or your own user "`Sites`" directory if you activated user directories as specified above. 
+In case you don't remember,  your Apache "`DocumentRoot`" is either the default directory  "`/opt/local/www/apache2/html`" or your own user "`Sites`" directory if you activated user directories as specified above. 
 Point your browser to `http://localhost/phpinfo.php` (or `http://localhost/~username/phpinfo.php` as applicable) and verify that the correct version of PHP is active and that MySQL support is active (you may want to search the page for "`mysql`"). \\
 Note that this file needs to be readable and executable.
 
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/MAMP>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'howto/MAMP' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list