Changes between Version 24 and Version 25 of howto/PHP


Ignore:
Timestamp:
Mar 26, 2020, 1:32:56 PM (5 years ago)
Author:
haraldgroven (Harald)
Comment:

PHP 7.4 is current version, please verify with clean install of osx

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v24 v25  
    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 * '''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.
    1617* '''php72''': PHP v7.2.x. This is an older stable version. Active support until Nov 30 2019.  Security support until Nov 30 2020.
    1718* '''php71''': PHP v7.1.x. This is an older stable version. Active support ended Dec 1 2018.  Security support until Dec 1 2020.
     
    2425
    2526
    26 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.
     27This 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.
    2728
    2829= Step 1: Install PHP SAPIs = #install
     
    3132
    3233||=SAPI                    =||=Port                =||=Install command                         =||
    33 || Command line             || php73                || `sudo port install php73`                ||
    34 || Apache 2 module          || php73-apache2handler || `sudo port install php73-apache2handler` ||
    35 || FastCGI                  || php73-cgi            || `sudo port install php73-cgi`            ||
    36 || FastCGI Process Manager  || php73-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`            ||
    3738
    3839
    3940= Step 2: Install PHP Modules = #modules
    4041
    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 php73` to see all the ports that are available.
     42The 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.
    4243
    4344Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
     
    4647
    4748||=Database server         =||=Port                =||=Install command                         =||
    48 || MSSQL                    || php73-mssql          || `sudo port install php73-mssql`          ||
    49 || MySQL, MariaDB, Percona  || php73-mysql          || `sudo port install php73-mysql`          ||
    50 || ODBC                     || php73-odbc           || `sudo port install php73-odbc`           ||
    51 || Oracle                   || php73-oracle         || `sudo port install php73-oracle`         ||
    52 || PostgreSQL               || php73-postgresql     || `sudo port install php73-postgresql`     ||
    53 || SQLite                   || php73-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`         ||
    5455
    5556
     
    5859Set up your PHP configuration files. For development purposes use:
    5960{{{
    60 $ cd /opt/local/etc/php73
     61$ cd /opt/local/etc/php74
    6162$ sudo cp php.ini-development php.ini
    6263}}}
    6364or for a production server:
    6465{{{
    65 $ cd /opt/local/etc/php73
     66$ cd /opt/local/etc/php74
    6667$ sudo cp php.ini-production php.ini
    6768}}}
    68 then make changes to that newly created php.ini file - ''/opt/local/etc/php73/php.ini''
     69then make changes to that newly created php.ini file - ''/opt/local/etc/php74/php.ini''
    6970
    7071= Step 4: Install phpMyAdmin  = #phpmyadmin
     
    8384= Trouble shoot =
    8485If 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_php73.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
     86Typically,  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.
    8687
    8788==  Verify your config file again! ==
     
    9394}}}
    9495This 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_php73.conf: Permission denied"''
     96 The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php74.conf: Permission denied"''
    9697After correcting any config errors and saving the updated config file, simply run:
    9798{{{