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