Changes between Version 16 and Version 17 of howto/PHP


Ignore:
Timestamp:
Dec 18, 2015, 10:55:53 AM (9 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add more information about the different PHP SAPIs and modules

Legend:

Unmodified
Added
Removed
Modified
  • howto/PHP

    v16 v17  
    2222This 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.
    2323
    24 = Step 1: Install PHP = #install
    25 
    26 {{{
    27 $ sudo port install php70-apache2handler
    28 $ sudo port install php70-mysql
    29 }}}
    30 
    31 
    32   '''''Note:''''' the php70 port contains 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.
    33 
    34 
    35 = Step 2: PHP Configuration file setup =
     24= Step 1: Install PHP SAPIs = #install
     25
     26PHP comes in several Server APIs (SAPIs). You can install any or all of these that you need:
     27
     28||=SAPI                    =||=Port                =||=Install command                         =||
     29|| Command line             || php70                || `sudo port install php70`                ||
     30|| Apache 2 module          || php70-apache2handler || `sudo port install php70-apache2handler` ||
     31|| FastCGI                  || php70-cgi            || `sudo port install php70-cgi`            ||
     32|| FastCGI Process Manager  || php70-fpm            || `sudo port install php70-fpm`            ||
     33
     34
     35= Step 2: Install PHP Modules = #modules
     36
     37The 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.
     38
     39Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version.
     40
     41For example, if you with to interact with a database server, here are some of the choices that exist:
     42
     43||=Database server         =||=Port                =||=Install command                         =||
     44|| MSSQL                    || php70-mssql          || `sudo port install php70-mssql`          ||
     45|| MySQL, MariaDB, Percona  || php70-mysql          || `sudo port install php70-mysql`          ||
     46|| ODBC                     || php70-odbc           || `sudo port install php70-odbc`           ||
     47|| Oracle                   || php70-oracle         || `sudo port install php70-oracle`         ||
     48|| PostgreSQL               || php70-postgresql     || `sudo port install php70-postgresql`     ||
     49|| SQLite                   || php70-sqlite         || `sudo port install php70-sqlite`         ||
     50
     51
     52= Step 3: PHP Configuration file setup = #configuration
    3653
    3754Set up your PHP configuration files. For development purposes use:
     
    4764then make changes to that newly created php.ini file - ''/opt/local/etc/php70/php.ini''
    4865
    49 = Step 3: Install phpMyAdmin  = #phpmyadmin
     66= Step 4: Install phpMyAdmin  = #phpmyadmin
    5067
    5168Use MacPorts to install the latest version of `phpMyAdmin`.
     
    5774'''phpMyAdmin''' must be configured before it can be used. We do this in Step 5 below.
    5875
    59 = Step 4: Visit [[howto/MAMP]] for integration information =
     76= Step 5: Visit [[howto/MAMP]] for integration information =
    6077 [[howto/MAMP]] must be consulted next for modifications to the Apache Configuration file to enable PHP and MySQL.
    6178
     
    102119As a last check, reboot and verify that everything has autostarted and is running (i.e., repeat the above tests).
    103120
    104 = Step 5: Configure phpMyAdmin =
     121= Step 6: Configure phpMyAdmin =
    105122
    106123Edit the phpMyAdmin configuration file at ''/opt/local/www/phpmyadmin/config.inc.php''. \\