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 | |
| 26 | PHP 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 | |
| 37 | 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 php70` to see all the ports that are available. |
| 38 | |
| 39 | Installing a PHP module automatically makes it available to all PHP SAPIs of the same PHP version. |
| 40 | |
| 41 | For 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 |