Changes between Version 15 and Version 16 of howto/PHP
- Timestamp:
- Dec 18, 2015, 10:35:59 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/PHP
v15 v16 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 * '''php70''': PHP v7.0.x. This is a developmentversion.16 * '''php56''': PHP v5.6.x. This is the lateststable version.15 * '''php70''': PHP v7.0.x. This is the latest stable version. 16 * '''php56''': PHP v5.6.x. This is an older stable version. 17 17 * '''php55''': PHP v5.5.x. This is an older stable version. 18 18 * '''php54''': PHP v5.4.x. This version reached [http://php.net/eol.php end of life] in 2015 and is therefore not recommended. … … 20 20 * '''php52''': PHP v5.2.x. This version reached [http://php.net/eol.php end of life] in 2011 and is therefore not recommended. 21 21 22 This page shows how to install and use the php 56family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.23 24 = Step 1: Install PHP 56= #install25 26 {{{ 27 $ sudo port install php 56-apache2handler28 $ sudo port install php 56-mysql29 }}} 30 31 32 '''''Note:''''' the php 56 port contains 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 php56` to see all the ports that are available.22 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. 23 24 = Step 1: Install PHP = #install 25 26 {{{ 27 $ sudo port install php70-apache2handler 28 $ sudo port install php70-mysql 29 }}} 30 31 32 '''''Note:''''' the php70 port contains 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 php70` to see all the ports that are available. 33 33 34 34 … … 37 37 Set up your PHP configuration files. For development purposes use: 38 38 {{{ 39 $ cd /opt/local/etc/php 5639 $ cd /opt/local/etc/php70 40 40 $ sudo cp php.ini-development php.ini 41 41 }}} 42 42 or for a production server: 43 43 {{{ 44 $ cd /opt/local/etc/php 5644 $ cd /opt/local/etc/php70 45 45 $ sudo cp php.ini-production php.ini 46 46 }}} 47 then make changes to that newly created php.ini file - ''/opt/local/etc/php 56/php.ini''47 then make changes to that newly created php.ini file - ''/opt/local/etc/php70/php.ini'' 48 48 49 49 = Step 3: Install phpMyAdmin = #phpmyadmin … … 62 62 = Trouble shoot = 63 63 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. 64 Typically, the file ''"Include conf/extra/mod_php 56.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.64 Typically, the file ''"Include conf/extra/mod_php70.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below. 65 65 66 66 == Verify your config file again! == … … 72 72 }}} 73 73 This will return either "Syntax OK" or a specific line by line error listing. 74 The typical error message: ''"Could not open configuration file /opt/local/apache2/conf/extra/httpd-mod_php 56.conf: Permission denied"''74 The typical error message: ''"Could not open configuration file /opt/local/apache2/conf/extra/httpd-mod_php70.conf: Permission denied"'' 75 75 After correcting any config errors and saving the updated config file, simply run: 76 76 {{{