[MacPorts] howto/PHP modified
MacPorts Wiki
noreply at macports.org
Thu Mar 26 13:32:57 UTC 2020
Page "howto/PHP" was changed by haraldgroven
Diff URL: <https://trac.macports.org/wiki/howto/PHP?action=diff&version=25>
Revision 25
Comment: PHP 7.4 is current version, please verify with clean install of osx
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/PHP
=========================================================================
--- howto/PHP (version: 24)
+++ howto/PHP (version: 25)
@@ -12,7 +12,8 @@
MacPorts includes several versions of PHP. You can install any or all of these versions simultaneously, though it is expected that you will only need to install one of them.
-* '''php73''': PHP v7.3.x. This is the latest stable version. Active support until Dec 6 2020. Security support until Dec 6 2021.
+* '''php74''': PHP v7.4.x. This is the latest stable version. Security support until Nov 28 2022
+* '''php73''': PHP v7.3.x. This is an older stable version. Active support until Dec 6 2020. Security support until Dec 6 2021.
* '''php72''': PHP v7.2.x. This is an older stable version. Active support until Nov 30 2019. Security support until Nov 30 2020.
* '''php71''': PHP v7.1.x. This is an older stable version. Active support ended Dec 1 2018. Security support until Dec 1 2020.
* '''php70''': PHP v7.0.x. This version reached [http://php.net/eol.php end of life] on 10 Jan 2019 and is therefore not recommended.
@@ -23,49 +24,49 @@
* '''php52''': PHP v5.2.x. This version reached [http://php.net/eol.php end of life] in 2011 and is therefore not recommended.
-This page shows how to install and use the php73 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.
+This page shows how to install and use the php74 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.
= Step 1: Install PHP SAPIs = #install
PHP comes in several Server APIs (SAPIs). You can install any or all of these that you need:
||=SAPI =||=Port =||=Install command =||
-|| Command line || php73 || `sudo port install php73` ||
-|| Apache 2 module || php73-apache2handler || `sudo port install php73-apache2handler` ||
-|| FastCGI || php73-cgi || `sudo port install php73-cgi` ||
-|| FastCGI Process Manager || php73-fpm || `sudo port install php73-fpm` ||
+|| Command line || php74 || `sudo port install php74` ||
+|| Apache 2 module || php74-apache2handler || `sudo port install php74-apache2handler` ||
+|| FastCGI || php74-cgi || `sudo port install php74-cgi` ||
+|| FastCGI Process Manager || php74-fpm || `sudo port install php74-fpm` ||
= Step 2: Install PHP Modules = #modules
-The SAPI ports contain the core PHP features, but there are many optional features available in separate ports, some of which you may want to install as well. Use `port search php73` to see all the ports that are available.
+The SAPI ports contain the core PHP features, but there are many optional features available in separate ports, some of which you may want to install as well. Use `port search php74` to see all the ports that are available.
Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
For example, if you with to interact with a database server, here are some of the choices that exist:
||=Database server =||=Port =||=Install command =||
-|| MSSQL || php73-mssql || `sudo port install php73-mssql` ||
-|| MySQL, MariaDB, Percona || php73-mysql || `sudo port install php73-mysql` ||
-|| ODBC || php73-odbc || `sudo port install php73-odbc` ||
-|| Oracle || php73-oracle || `sudo port install php73-oracle` ||
-|| PostgreSQL || php73-postgresql || `sudo port install php73-postgresql` ||
-|| SQLite || php73-sqlite || `sudo port install php73-sqlite` ||
+|| MSSQL || php74-mssql || `sudo port install php74-mssql` ||
+|| MySQL, MariaDB, Percona || php74-mysql || `sudo port install php74-mysql` ||
+|| ODBC || php74-odbc || `sudo port install php74-odbc` ||
+|| Oracle || php74-oracle || `sudo port install php74-oracle` ||
+|| PostgreSQL || php74-postgresql || `sudo port install php74-postgresql` ||
+|| SQLite || php74-sqlite || `sudo port install php74-sqlite` ||
= Step 3: PHP Configuration file setup = #configuration
Set up your PHP configuration files. For development purposes use:
{{{
-$ cd /opt/local/etc/php73
+$ cd /opt/local/etc/php74
$ sudo cp php.ini-development php.ini
}}}
or for a production server:
{{{
-$ cd /opt/local/etc/php73
+$ cd /opt/local/etc/php74
$ sudo cp php.ini-production php.ini
}}}
-then make changes to that newly created php.ini file - ''/opt/local/etc/php73/php.ini''
+then make changes to that newly created php.ini file - ''/opt/local/etc/php74/php.ini''
= Step 4: Install phpMyAdmin = #phpmyadmin
@@ -82,7 +83,7 @@
= Trouble shoot =
If by some reason the server still doesn't interpret PHP files (i.e. your web client tries to download them) it means the PHP configurations, as described at [[howto/MAMP#job1]], are not taking effect.
-Typically, the file ''"Include etc/apache2/extra/mod_php73.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
+Typically, the file ''"Include etc/apache2/extra/mod_php74.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
== Verify your config file again! ==
Verify any changes you have made to the config file: /opt/local/etc/apache2/httpd.conf - The most common problem is that the files in the "extra" directory are not "readable"
@@ -92,7 +93,7 @@
$ /opt/local/sbin/apachectl -t
}}}
This will return either "Syntax OK" or a specific line by line error listing.
- The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php73.conf: Permission denied"''
+ The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php74.conf: Permission denied"''
After correcting any config errors and saving the updated config file, simply run:
{{{
$ sudo port unload apache2
-------8<------8<------8<------8<------8<------8<------8<------8<--------
--
Page URL: <https://trac.macports.org/wiki/howto/PHP>
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/PHP' page.
If it was not you, please report to admin at macports.org.
More information about the macports-changes
mailing list