Changes between Version 21 and Version 22 of howto/PHP


Ignore:
Timestamp:
Jun 9, 2019, 3:19:38 AM (5 years ago)
Author:
billc108
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v21 v22  
    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 * '''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.
    1921* '''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
     24This 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.
    2425
    2526= Step 1: Install PHP SAPIs = #install
     
    2829
    2930||=SAPI                    =||=Port                =||=Install command                         =||
    30 || Command line             || php70                || `sudo port install php70`                ||
    31 || Apache 2 module          || php70-apache2handler || `sudo port install php70-apache2handler` ||
    32 || FastCGI                  || php70-cgi            || `sudo port install php70-cgi`            ||
    33 || FastCGI Process Manager  || php70-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`            ||
    3435
    3536
    3637= Step 2: Install PHP Modules = #modules
    3738
    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 php70` to see all the ports that are available.
     39The 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.
    3940
    4041Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
     
    4344
    4445||=Database server         =||=Port                =||=Install command                         =||
    45 || MSSQL                    || php70-mssql          || `sudo port install php70-mssql`          ||
    46 || MySQL, MariaDB, Percona  || php70-mysql          || `sudo port install php70-mysql`          ||
    47 || ODBC                     || php70-odbc           || `sudo port install php70-odbc`           ||
    48 || Oracle                   || php70-oracle         || `sudo port install php70-oracle`         ||
    49 || PostgreSQL               || php70-postgresql     || `sudo port install php70-postgresql`     ||
    50 || SQLite                   || php70-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`         ||
    5152
    5253
     
    5556Set up your PHP configuration files. For development purposes use:
    5657{{{
    57 $ cd /opt/local/etc/php70
     58$ cd /opt/local/etc/php73
    5859$ sudo cp php.ini-development php.ini
    5960}}}
    6061or for a production server:
    6162{{{
    62 $ cd /opt/local/etc/php70
     63$ cd /opt/local/etc/php73
    6364$ sudo cp php.ini-production php.ini
    6465}}}
    65 then make changes to that newly created php.ini file - ''/opt/local/etc/php70/php.ini''
     66then make changes to that newly created php.ini file - ''/opt/local/etc/php73/php.ini''
    6667
    6768= Step 4: Install phpMyAdmin  = #phpmyadmin
     
    8081= Trouble shoot =
    8182If 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_php70.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
     83Typically,  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.
    8384
    8485==  Verify your config file again! ==
     
    9091}}}
    9192This 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_php70.conf: Permission denied"''
     93 The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php73.conf: Permission denied"''
    9394After correcting any config errors and saving the updated config file, simply run:
    9495{{{