Adding PHP 5 Support On Windows
Upgrading from a previous version
If you have already installed a previous version of the preconfigured PHP 5 package and want to upgrade it, all you have to do is to download the new version of the package and install it. No additional configuration has to be done in Abyss Web Server console.
Note that if you are upgrading from 5.2.10 to 5.3.8 or from 5.3.8 to 5.4.0 for example, you may need to tweak your php.ini file to remove references to obsolete PHP extensions. This is usually not required if you upgrade from 5.3.8 to 5.3.12 or from 5.4.0 to 5.4.2.
PHP 5 Setup
Download and install PHP 5
- If you are using Windows Vista, 7, 8, 8.1, 10, 2008 and 2012 or later, download the preconfigured PHP 5.6.30 package for Windows or the preconfigured PHP 5.5.35 package for Windows.
- If you are using Windows XP or 2003, download the preconfigured PHP 5.4.45 package for Windows.
- If you have an older operating system or if your scripts require an old version of PHP, pick the most suitable preconfigured package from our downloads page and follow the instructions below to declare it.
- The preconfigured package you have just downloaded contains the core PHP binaries and all its official extensions and runs on both 32 and 64-bit editions of Windows. They were preconfigured by Aprelium to support most popular scripts.
It also includes following built-in extensions: bcmath, calendar, cgi-fcgi, com_dotnet, ctype, date, dba, dom, filter, ftp, hash, iconv, json, libxml, pcre, Reflection, session, SimpleXML, SPL, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, and zlib. Support for mbstring, cURL, GD2, IMAP, GetText, LDAP, OpenSSL, PDO, ODBC, SQLite, MySQL, and MySQLi is also turned on by default. It may also include the ImageMagick extension and may have it enabled by default.
Several other extensions are also available but are not enabled by default. You can activate them by editing the php.ini file as explained below.
- Install the package contents in a directory of your choice (for example in C:\Program Files\PHP5).
Declare the interpreter
Open Abyss Web Server's console. In the Hosts table, press Configure in the row corresponding to the host to which you want to add PHP 5 support.
If there is no Hosts table in the main screen of your console, this means that you are using an old version of Abyss Web Server. Please upgrade to the latest version before proceeding. Upgrading is free, straightforward, and preserves your current server configuration. Click here to download the latest version.
- Select Scripting Parameters.
- Check Enable Scripts Execution.
- Press Add in the Interpreters table.
If you are using Windows NT, 2000, XP, 2003, Vista, 7, 8, 8.1, 2008, 2012 Server or later, set Interface to FastCGI (Local - Pipes). If you are using Windows 95, 98, or ME, set Interface to CGI/ISAPI as PHP does not support the FastCGI interface on these old operating systems.
Note that if you do not find an Interface field, you can ignore this step and continue with the following instructions.
The absence of the Interface field means that your Abyss Web Server X1 and X2 version number is less than 2.3. If this is the case, we strongly recommend to upgrade to the latest version to benefit from the FastCGI performance boost.
If after adding PHP support, your PHP scripts refuse to run and report Error 503, this is probably because your PHP interpreter does not support the FastCGI mode. In such a case, set its Interface field to CGI/ISAPI to solve the problem.
- In the Interpreter field, press Browse..., go to the directory where you have installed PHP 5, locate php-cgi.exe, and click on it.
- Set Type to Standard. Note that you should no more use PHP Style as it was only meant to activate special internal workarounds to support PHP versions < 5.2.4.
- Check Use the associated extensions to automatically update the Script Paths.
- Press Add in the Associated Extensions table.
- Enter php in the Extension field and press OK.
- Press OK
- Press OK in the Scripting Parameters dialog.
Declare new index files
- Select Index Files.
- Press Add in the Index Files table.
- Enter index.php in the File Name field and press OK.
Apply the modifications
- Press Restart to restart the server.
Notes about php.ini
- The preconfigured PHP 5 package will use the php.ini file that is located inside its installation directory (which is the directory where php-cgi.exe is located).
If you need to have php.ini in another location, please change the value of the custom environment variable PHPRC. For example, if your php.ini file is located inside C:\mysettings, declare a new Custom Environment Variable which name is PHPRC and value is set to:
The default php.ini file that ships with the preconfigured PHP 5 package for Windows has ImageMagick, mbstring, cURL, GD2, IMAP, GetText, LDAP, OpenSSL, PDO, ODBC, SQLite, MySQL, and MySQLi extensions enabled by default.
MySQLi extension provides support for MySQL 4.1 and higher. If you have experienced error messages from PHP stating that MySQL error #1251 occurred, then you need the MySQLi extension.
To enable other extensions, open php.ini with your favorite text editor (for example Windows Notepad), locate the line that contains the extension name, uncomment it by removing the leading colon character, and save the file.
For example, if you want to enable the PHP PDF extension (to generate PDF on the fly):
- Open php.ini with Windows Notepad.
- Search for php_pdf.dll
The line that contains the php_pdf.dll occurrence should look like:
Delete the comma in the beginning of the line so that it becomes:
- Save the file and close Windows Notepad.
- Stop and restart Abyss Web Server to ensure that all PHP will take into account the modification of php.ini.