Changes between Version 27 and Version 28 of howto/PHP
- Timestamp:
- May 7, 2022, 7:58:51 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/PHP
v27 v28 13 13 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. 14 14 15 * '''php80''': PHP v8.0.x. This is the latest stable version. Security support until 26 Nov 2023. 15 * '''php81''': PHP v8.1.x. This is the latest stable version. Security support until 25 Nov 2024. 16 * '''php80''': PHP v8.0.x. This is an older stable version. Security support until 26 Nov 2023. 16 17 * '''php74''': PHP v7.4.x. This is an older stable version. Active support until 28 Nov 2021. Security support until 28 Nov 2022. 17 * '''php73''': PHP v7.3.x. This is an older stable version. Active support until 6 Dec 2020. Security support until6 Dec 2021.18 * '''php73''': PHP v7.3.x. This version reached [https://www.php.net/eol.php end of life] on 6 Dec 2021. 18 19 * '''php72''': PHP v7.2.x. This version reached [https://www.php.net/eol.php end of life] on 30 Nov 2020 and is therefore not recommended. 19 20 * '''php71''': PHP v7.1.x. This version reached [https://www.php.net/eol.php end of life] on 1 Dec 2019 and is therefore not recommended. … … 26 27 27 28 28 This page shows how to install and use the php8 0family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.29 This page shows how to install and use the php81 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout. 29 30 30 31 = Step 1: Install PHP SAPIs = #install … … 33 34 34 35 ||=SAPI =||=Port =||=Install command =|| 35 || Command line || php8 0 || `sudo port install php80` ||36 || Apache 2 module || php8 0-apache2handler || `sudo port install php80-apache2handler` ||37 || FastCGI || php8 0-cgi || `sudo port install php80-cgi` ||38 || FastCGI Process Manager || php8 0-fpm || `sudo port install php80-fpm` ||36 || Command line || php81 || `sudo port install php81` || 37 || Apache 2 module || php81-apache2handler || `sudo port install php81-apache2handler` || 38 || FastCGI || php81-cgi || `sudo port install php81-cgi` || 39 || FastCGI Process Manager || php81-fpm || `sudo port install php81-fpm` || 39 40 40 41 41 42 = Step 2: Install PHP Modules = #modules 42 43 43 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 php8 0` to see all the ports that are available.44 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 php81` to see all the ports that are available. 44 45 45 46 Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version. … … 48 49 49 50 ||=Database server =||=Port =||=Install command =|| 50 || MSSQL || php8 0-mssql || `sudo port install php80-mssql` ||51 || MySQL, MariaDB, Percona || php8 0-mysql || `sudo port install php80-mysql` ||52 || ODBC || php8 0-odbc || `sudo port install php80-odbc` ||53 || Oracle || php8 0-oracle || `sudo port install php80-oracle` ||54 || PostgreSQL || php8 0-postgresql || `sudo port install php80-postgresql` ||55 || SQLite || php8 0-sqlite || `sudo port install php80-sqlite` ||51 || MSSQL || php81-mssql || `sudo port install php81-mssql` || 52 || MySQL, MariaDB, Percona || php81-mysql || `sudo port install php81-mysql` || 53 || ODBC || php81-odbc || `sudo port install php81-odbc` || 54 || Oracle || php81-oracle || `sudo port install php81-oracle` || 55 || PostgreSQL || php81-postgresql || `sudo port install php81-postgresql` || 56 || SQLite || php81-sqlite || `sudo port install php81-sqlite` || 56 57 57 58 … … 60 61 Set up your PHP configuration files. For development purposes use: 61 62 {{{ 62 $ cd /opt/local/etc/php8 063 $ cd /opt/local/etc/php81 63 64 $ sudo cp php.ini-development php.ini 64 65 }}} 65 66 or for a production server: 66 67 {{{ 67 $ cd /opt/local/etc/php8 068 $ cd /opt/local/etc/php81 68 69 $ sudo cp php.ini-production php.ini 69 70 }}} 70 then make changes to that newly created php.ini file - ''/opt/local/etc/php8 0/php.ini''71 then make changes to that newly created php.ini file - ''/opt/local/etc/php81/php.ini'' 71 72 72 73 = Step 4: Install phpMyAdmin = #phpmyadmin … … 85 86 = Trouble shoot = 86 87 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. 87 Typically, the file ''"Include etc/apache2/extra/mod_php8 0.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.88 Typically, the file ''"Include etc/apache2/extra/mod_php81.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below. 88 89 89 90 == Verify your config file again! == … … 95 96 }}} 96 97 This will return either "Syntax OK" or a specific line by line error listing. 97 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php8 0.conf: Permission denied"''98 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php81.conf: Permission denied"'' 98 99 After correcting any config errors and saving the updated config file, simply run: 99 100 {{{