Changes between Version 33 and Version 34 of howto/PHP
- Timestamp:
- Aug 30, 2023, 12:24:03 PM (15 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/PHP
v33 v34 28 28 29 29 30 This page shows how to install and use the php8 1family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout.30 This page shows how to install and use the php82 family of ports, but you can use another version if you prefer; all of these ports use a similar directory layout. 31 31 32 32 = Step 1: Install PHP SAPIs = #install … … 35 35 36 36 ||=SAPI =||=Port =||=Install command =|| 37 || Command line || php8 1 || `sudo port install php81` ||38 || Apache 2 module || php8 1-apache2handler || `sudo port install php81-apache2handler` ||39 || FastCGI || php8 1-cgi || `sudo port install php81-cgi` ||40 || FastCGI Process Manager || php8 1-fpm || `sudo port install php81-fpm` ||37 || Command line || php82 || `sudo port install php82` || 38 || Apache 2 module || php82-apache2handler || `sudo port install php82-apache2handler` || 39 || FastCGI || php82-cgi || `sudo port install php82-cgi` || 40 || FastCGI Process Manager || php82-fpm || `sudo port install php82-fpm` || 41 41 42 42 43 43 = Step 2: Install PHP Modules = #modules 44 44 45 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 php8 1` to see all the ports that are available.45 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 php82` to see all the ports that are available. 46 46 47 47 Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version. … … 50 50 51 51 ||=Database server =||=Port =||=Install command =|| 52 || MSSQL || php81-mssql || `sudo port install php81-mssql` || 53 || MySQL, MariaDB, Percona || php81-mysql || `sudo port install php81-mysql` || 54 || ODBC || php81-odbc || `sudo port install php81-odbc` || 55 || Oracle || php81-oracle || `sudo port install php81-oracle` || 56 || PostgreSQL || php81-postgresql || `sudo port install php81-postgresql` || 57 || SQLite || php81-sqlite || `sudo port install php81-sqlite` || 52 || MySQL, MariaDB, Percona || php82-mysql || `sudo port install php82-mysql` || 53 || ODBC || php82-odbc || `sudo port install php82-odbc` || 54 || Oracle || php82-oracle || `sudo port install php82-oracle` || 55 || PostgreSQL || php82-postgresql || `sudo port install php82-postgresql` || 56 || SQLite || php82-sqlite || `sudo port install php82-sqlite` || 58 57 59 58 … … 62 61 Set up your PHP configuration files. For development purposes use: 63 62 {{{ 64 $ cd /opt/local/etc/php8 163 $ cd /opt/local/etc/php82 65 64 $ sudo cp php.ini-development php.ini 66 65 }}} 67 66 or for a production server: 68 67 {{{ 69 $ cd /opt/local/etc/php8 168 $ cd /opt/local/etc/php82 70 69 $ sudo cp php.ini-production php.ini 71 70 }}} 72 then make changes to that newly created php.ini file - ''/opt/local/etc/php8 1/php.ini''71 then make changes to that newly created php.ini file - ''/opt/local/etc/php82/php.ini'' 73 72 74 73 = Step 4: Install phpMyAdmin = #phpmyadmin … … 87 86 = Trouble shoot = 88 87 If 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. 89 Typically, the file ''"Include etc/apache2/extra/mod_php8 1.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below.88 Typically, the file ''"Include etc/apache2/extra/mod_php82.conf"'' - is not being processed; the file is missing; or the contents incorrect. That file contains the two "AddType" lines below. 90 89 91 90 == Verify your config file again! == … … 97 96 }}} 98 97 This will return either "Syntax OK" or a specific line by line error listing. 99 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php8 1.conf: Permission denied"''98 The typical error message: ''"Could not open configuration file /opt/local/etc/apache2/extra/httpd-mod_php82.conf: Permission denied"'' 100 99 After correcting any config errors and saving the updated config file, simply run: 101 100 {{{