Changes between Version 21 and Version 22 of howto/PHP
- Timestamp:
- Jun 9, 2019, 3:19:38 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/PHP
v21 v22 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 * '''php71''': PHP v7.1.x. This is the latest development version. 16 * '''php70''': PHP v7.0.x. This is the latest stable version. 17 * '''php56''': PHP v5.6.x. This is an older stable version. 18 * '''php55''': PHP v5.5.x. This is an older stable version. 15 * '''php73''': PHP v7.3.x. This is the latest stable version. 16 * '''php72''': PHP v7.2.x. This is an older stable version. 17 * '''php71''': PHP v7.1.x. This is an older stable version. 18 * '''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. 19 * '''php56''': PHP v5.6.x. This version reached [http://php.net/eol.php end of life] on 31 Dec 2018 and is therefore not recommended. 20 * '''php55''': PHP v5.5.x. This version reached [http://php.net/eol.php end of life] on 21 Jul 2016 and is therefore not recommended. 19 21 * '''php54''': PHP v5.4.x. This version reached [http://php.net/eol.php end of life] in 2015 and is therefore not recommended. 20 * '''php53''': PHP v5.3.x. This version reached [http://php.net/eol.php end of life] in 2014 and is therefore not recommended. 21 * '''php52''': PHP v5.2.x. This version reached [http://php.net/eol.php end of life] in 2011 and is therefore not recommended. 22 23 This page shows how to install and use the php70 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout. 22 23 24 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. 24 25 25 26 = Step 1: Install PHP SAPIs = #install … … 28 29 29 30 ||=SAPI =||=Port =||=Install command =|| 30 || Command line || php7 0 || `sudo port install php70` ||31 || Apache 2 module || php7 0-apache2handler || `sudo port install php70-apache2handler` ||32 || FastCGI || php7 0-cgi || `sudo port install php70-cgi` ||33 || FastCGI Process Manager || php7 0-fpm || `sudo port install php70-fpm` ||31 || Command line || php73 || `sudo port install php73` || 32 || Apache 2 module || php73-apache2handler || `sudo port install php73-apache2handler` || 33 || FastCGI || php73-cgi || `sudo port install php73-cgi` || 34 || FastCGI Process Manager || php73-fpm || `sudo port install php73-fpm` || 34 35 35 36 36 37 = Step 2: Install PHP Modules = #modules 37 38 38 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 0` to see all the ports that are available.39 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. 39 40 40 41 Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version. … … 43 44 44 45 ||=Database server =||=Port =||=Install command =|| 45 || MSSQL || php7 0-mssql || `sudo port install php70-mssql` ||46 || MySQL, MariaDB, Percona || php7 0-mysql || `sudo port install php70-mysql` ||47 || ODBC || php7 0-odbc || `sudo port install php70-odbc` ||48 || Oracle || php7 0-oracle || `sudo port install php70-oracle` ||49 || PostgreSQL || php7 0-postgresql || `sudo port install php70-postgresql` ||50 || SQLite || php7 0-sqlite || `sudo port install php70-sqlite` ||46 || MSSQL || php73-mssql || `sudo port install php73-mssql` || 47 || MySQL, MariaDB, Percona || php73-mysql || `sudo port install php73-mysql` || 48 || ODBC || php73-odbc || `sudo port install php73-odbc` || 49 || Oracle || php73-oracle || `sudo port install php73-oracle` || 50 || PostgreSQL || php73-postgresql || `sudo port install php73-postgresql` || 51 || SQLite || php73-sqlite || `sudo port install php73-sqlite` || 51 52 52 53 … … 55 56 Set up your PHP configuration files. For development purposes use: 56 57 {{{ 57 $ cd /opt/local/etc/php7 058 $ cd /opt/local/etc/php73 58 59 $ sudo cp php.ini-development php.ini 59 60 }}} 60 61 or for a production server: 61 62 {{{ 62 $ cd /opt/local/etc/php7 063 $ cd /opt/local/etc/php73 63 64 $ sudo cp php.ini-production php.ini 64 65 }}} 65 then make changes to that newly created php.ini file - ''/opt/local/etc/php7 0/php.ini''66 then make changes to that newly created php.ini file - ''/opt/local/etc/php73/php.ini'' 66 67 67 68 = Step 4: Install phpMyAdmin = #phpmyadmin … … 80 81 = Trouble shoot = 81 82 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. 82 Typically, the file ''"Include etc/apache2/extra/mod_php7 0.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.83 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. 83 84 84 85 == Verify your config file again! == … … 90 91 }}} 91 92 This will return either "Syntax OK" or a specific line by line error listing. 92 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php7 0.conf: Permission denied"''93 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php73.conf: Permission denied"'' 93 94 After correcting any config errors and saving the updated config file, simply run: 94 95 {{{