Changes between Version 25 and Version 26 of howto/PHP


Ignore:
Timestamp:
Feb 18, 2021, 10:16:22 PM (3 years ago)
Author:
mav2287 (James)
Comment:

Updated to reflect release of PHP80

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v25 v26  
    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 * '''php74''': PHP v7.4.x. This is the latest stable version. Security support until Nov 28 2022
     15* '''php80''': PHP v8.0.x. This is the latest stable version. Security support until Nov 26 2023
     16* '''php74''': PHP v7.4.x. This is an older stable version. Active support until Nov 26 2020.  Security support until Nov 26 2023.
    1617* '''php73''': PHP v7.3.x. This is an older stable version. Active support until Dec 6 2020.  Security support until Dec 6 2021.
    1718* '''php72''': PHP v7.2.x. This is an older stable version. Active support until Nov 30 2019.  Security support until Nov 30 2020.
     
    2526
    2627
    27 This 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.
     28This page shows how to install and use the php80 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.
    2829
    2930= Step 1: Install PHP SAPIs = #install
     
    3233
    3334||=SAPI                    =||=Port                =||=Install command                         =||
    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`            ||
     35|| Command line             || php80                || `sudo port install php80`                ||
     36|| Apache 2 module          || php80-apache2handler || `sudo port install php80-apache2handler` ||
     37|| FastCGI                  || php80-cgi            || `sudo port install php80-cgi`            ||
     38|| FastCGI Process Manager  || php80-fpm            || `sudo port install php80-fpm`            ||
    3839
    3940
    4041= Step 2: Install PHP Modules = #modules
    4142
    42 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 php74` to see all the ports that are available.
     43The 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 php80` to see all the ports that are available.
    4344
    4445Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
     
    4748
    4849||=Database server         =||=Port                =||=Install command                         =||
    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`         ||
     50|| MSSQL                    || php80-mssql          || `sudo port install php80-mssql`          ||
     51|| MySQL, MariaDB, Percona  || php80-mysql          || `sudo port install php80-mysql`          ||
     52|| ODBC                     || php80-odbc           || `sudo port install php80-odbc`           ||
     53|| Oracle                   || php80-oracle         || `sudo port install php80-oracle`         ||
     54|| PostgreSQL               || php80-postgresql     || `sudo port install php80-postgresql`     ||
     55|| SQLite                   || php80-sqlite         || `sudo port install php80-sqlite`         ||
    5556
    5657
     
    5960Set up your PHP configuration files. For development purposes use:
    6061{{{
    61 $ cd /opt/local/etc/php74
     62$ cd /opt/local/etc/php80
    6263$ sudo cp php.ini-development php.ini
    6364}}}
    6465or for a production server:
    6566{{{
    66 $ cd /opt/local/etc/php74
     67$ cd /opt/local/etc/php80
    6768$ sudo cp php.ini-production php.ini
    6869}}}
    69 then make changes to that newly created php.ini file - ''/opt/local/etc/php74/php.ini''
     70then make changes to that newly created php.ini file - ''/opt/local/etc/php80/php.ini''
    7071
    7172= Step 4: Install phpMyAdmin  = #phpmyadmin
     
    8485= Trouble shoot =
    8586If 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.
    86 Typically,  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.
     87Typically,  the file ''"Include etc/apache2/extra/mod_php80.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
    8788
    8889==  Verify your config file again! ==
     
    9495}}}
    9596This will return either "Syntax OK" or a specific line by line error listing.
    96  The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php74.conf: Permission denied"''
     97 The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php80.conf: Permission denied"''
    9798After correcting any config errors and saving the updated config file, simply run:
    9899{{{