Changes between Version 27 and Version 28 of howto/PHP


Ignore:
Timestamp:
May 7, 2022, 7:58:51 AM (3 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

php81

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v27 v28  
    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 * '''php80''': PHP v8.0.x. This is the latest stable version. Security support until 26 Nov 2023.
     15* '''php81''': PHP v8.1.x. This is the latest stable version. Security support until 25 Nov 2024.
     16* '''php80''': PHP v8.0.x. This is an older stable version. Security support until 26 Nov 2023.
    1617* '''php74''': PHP v7.4.x. This is an older stable version. Active support until 28 Nov 2021. Security support until 28 Nov 2022.
    17 * '''php73''': PHP v7.3.x. This is an older stable version. Active support until 6 Dec 2020. Security support until 6 Dec 2021.
     18* '''php73''': PHP v7.3.x. This version reached [https://www.php.net/eol.php end of life] on 6 Dec 2021.
    1819* '''php72''': PHP v7.2.x. This version reached [https://www.php.net/eol.php end of life] on 30 Nov 2020 and is therefore not recommended.
    1920* '''php71''': PHP v7.1.x. This version reached [https://www.php.net/eol.php end of life] on 1 Dec 2019 and is therefore not recommended.
     
    2627
    2728
    28 This 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.
     29This page shows how to install and use the php81 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.
    2930
    3031= Step 1: Install PHP SAPIs = #install
     
    3334
    3435||=SAPI                    =||=Port                =||=Install command                         =||
    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`            ||
     36|| Command line             || php81                || `sudo port install php81`                ||
     37|| Apache 2 module          || php81-apache2handler || `sudo port install php81-apache2handler` ||
     38|| FastCGI                  || php81-cgi            || `sudo port install php81-cgi`            ||
     39|| FastCGI Process Manager  || php81-fpm            || `sudo port install php81-fpm`            ||
    3940
    4041
    4142= Step 2: Install PHP Modules = #modules
    4243
    43 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 php80` to see all the ports that are available.
     44The 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 php81` to see all the ports that are available.
    4445
    4546Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
     
    4849
    4950||=Database server         =||=Port                =||=Install command                         =||
    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`         ||
     51|| MSSQL                    || php81-mssql          || `sudo port install php81-mssql`          ||
     52|| MySQL, MariaDB, Percona  || php81-mysql          || `sudo port install php81-mysql`          ||
     53|| ODBC                     || php81-odbc           || `sudo port install php81-odbc`           ||
     54|| Oracle                   || php81-oracle         || `sudo port install php81-oracle`         ||
     55|| PostgreSQL               || php81-postgresql     || `sudo port install php81-postgresql`     ||
     56|| SQLite                   || php81-sqlite         || `sudo port install php81-sqlite`         ||
    5657
    5758
     
    6061Set up your PHP configuration files. For development purposes use:
    6162{{{
    62 $ cd /opt/local/etc/php80
     63$ cd /opt/local/etc/php81
    6364$ sudo cp php.ini-development php.ini
    6465}}}
    6566or for a production server:
    6667{{{
    67 $ cd /opt/local/etc/php80
     68$ cd /opt/local/etc/php81
    6869$ sudo cp php.ini-production php.ini
    6970}}}
    70 then make changes to that newly created php.ini file - ''/opt/local/etc/php80/php.ini''
     71then make changes to that newly created php.ini file - ''/opt/local/etc/php81/php.ini''
    7172
    7273= Step 4: Install phpMyAdmin  = #phpmyadmin
     
    8586= Trouble shoot =
    8687If 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.
    87 Typically,  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.
     88Typically,  the file ''"Include etc/apache2/extra/mod_php81.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.
    8889
    8990==  Verify your config file again! ==
     
    9596}}}
    9697This will return either "Syntax OK" or a specific line by line error listing.
    97  The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php80.conf: Permission denied"''
     98 The typical error message:  ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php81.conf: Permission denied"''
    9899After correcting any config errors and saving the updated config file, simply run:
    99100{{{