Changes between Version 15 and Version 16 of howto/PHP


Ignore:
Timestamp:
Dec 18, 2015, 10:35:59 AM (8 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

php70 is stable now

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v15 v16  
    1313MacPorts 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.
    1414
    15 * '''php70''': PHP v7.0.x. This is a development version.
    16 * '''php56''': PHP v5.6.x. This is the latest stable 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.
    1717* '''php55''': PHP v5.5.x. This is an older stable version.
    1818* '''php54''': PHP v5.4.x. This version reached [http://php.net/eol.php end of life] in 2015 and is therefore not recommended.
     
    2020* '''php52''': PHP v5.2.x. This version reached [http://php.net/eol.php end of life] in 2011 and is therefore not recommended.
    2121
    22 This page shows how to install and use the php56 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 56 = #install
    25 
    26 {{{
    27 $ sudo port install php56-apache2handler
    28 $ sudo port install php56-mysql
    29 }}}
    30 
    31 
    32   '''''Note:''''' the php56 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.
     22This 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.
    3333
    3434
     
    3737Set up your PHP configuration files. For development purposes use:
    3838{{{
    39 $ cd /opt/local/etc/php56
     39$ cd /opt/local/etc/php70
    4040$ sudo cp php.ini-development php.ini
    4141}}}
    4242or for a production server:
    4343{{{
    44 $ cd /opt/local/etc/php56
     44$ cd /opt/local/etc/php70
    4545$ sudo cp php.ini-production php.ini
    4646}}}
    47 then make changes to that newly created php.ini file - ''/opt/local/etc/php56/php.ini''
     47then make changes to that newly created php.ini file - ''/opt/local/etc/php70/php.ini''
    4848
    4949= Step 3: Install phpMyAdmin  = #phpmyadmin
     
    6262= Trouble shoot =
    6363If 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_php56.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
     64Typically,  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.
    6565
    6666==  Verify your config file again! ==
     
    7272}}}
    7373This 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_php56.conf: Permission denied"''
     74 The typical error message:  ''"Could not open configuration file /opt/local/apache2/conf/extra/httpd-mod_php70.conf: Permission denied"''
    7575After correcting any config errors and saving the updated config file, simply run:
    7676{{{