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