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