Zero logo

PHP

PHP is a general-purpose scripting language designed for creating dynamic web pages. The Apache server uses a PHP processor module to generate the final web page being served. It interprets code embedded into HTML documents. PHP has been pre-configured for test, production and development. A UniController sub-menu allows you to easily switch between the three configurations. This page covers configuration and additional features for maintaining PHP.

Note 1: A default installation of Uniform Server ZeroXI installs PHP as an Apache module you can configure PHP to run as Fast CGI using Apache module mod_fcgid see plugins - FCGID for details.
Note 2: PHP Net decided to skip PHP version 6.0

View phpInfo

PHP > View phpInfo

This menu button opens a page in the default browser, that runs the PHP function phpinfo() displaying a wealth of information relating to PHP. The page provides very detailed information, and a menu splits this into smaller sections, making it easier to read.

  • url=http://localhost:80/us_extra/phpinfo.php - Page displayed
  • Location: C:\UniServerZ\home\us_extra\phpinfo.php

PHP Info Menu

  • Configuration - Displays PHP Core configuration.
  • Enviroment - PHP current environment
  • Modules - List all modules
  • Extensions - Overview and details (includes functions) for all loaded extensions.
  • Variables - List all currently available PHP variables.
  • General - Intro information

Select PHP version

The Uniform Server Zero XI provides switching between PHP versions 5.2, 5.3, 5.4, 5.5, 5.6 or 7.0 to achieve this you need to download a suitable PHP plugin for each version (for example ZeroXI_php_5_2_17.exe, ZeroXI_php_5_3_29.exe, ZeroXI_php_5_4_35.exe, ZeroXI_php_5_5_19.exe, ZeroXI_php_5_6_3.exe and ZeroXI_php_7_0_0_dev.exe).

PHP > Select PHP version

Note: While Apache is running to prevent problems menu option is disabled (greyed out).

Selection:

  • Click version you wish to use A), B) C), D) , E) or F).
  • Previous selection is deselected and new selection enabled.
  • Selected PHP version is indicated by a check marker for example C).

Note 1: For the new settings to become effective you must restart the Apache server.
Note 2: Greyed out menu button indicates that PHP version plugin is not installed.

PHP switching

Note: Full menu details; see PHP Version Switching page.

Select PHP configuration file

The Uniform Server Zero XI provides switching between PHP configuration files php_test.ini, php_development.ini and php_production.ini

PHP > PHP configuration file

Note: While Apache is running to prevent problems menu option is disabled (greyed out).

Selection:

  • Click configuration file you wish to use A), B) or C).
  • Previous selection is deselected and new selection enabled.
  • Selected configuration file is indicated by a check marker for example C).

Note 1: For the new settings to become effective you must restart the Apache server.

PHP switching

Note:
In the following xxx represents the PHP series selected either php52, php53, php54, php55, php56 or php70 (covered above).

Test Configuration file

PHP > Select PHP configuration file > php_test.ini

  • File path: UniServerZ\core\xxx\php_test.ini
  • This configuration file is pre-configured and can be modified for testing before making changes to the other two configuration files.
  • Note 1: In a default installation of The Uniform Server Zero, the current configuration is a copy of this file (php_test.ini = php_production.ini).

Production Configuration file

PHP > Select PHP configuration file > php_production.ini

  • File path: UniServerZ\core\xxx\php_production.ini
  • This configuration file is pre-configured for production use.
  • Note 1: Errors are not displayed; these are directed to Apache's log file.

Development Configuration file

PHP > Select PHP configuration file > php_development.ini

  • File path: UniServer\core\xxx\php_development.ini
  • This configuration file is pre-configured for development.
  • Note 1: Errors are displayed in a user's browser and also directed to log file

Edited selected configuration file

The following menu allows you to edit the currently selected (covered above) PHP configuration file in notepad.
Note: While Apache is running to prevent problems menu option is disabled (greyed out).

PHP > Edited selected configuration file

  • Note: This configuration file is the active configuration. When Apache is started, the contents of this file will configure PHP.

Edit Basic and Modules

Edit Basic Configuration

PHP > Edit Basic and Modules > Edit Basic Configuration

This menu item allows you to change commonly configured PHP options.
Note: While Apache is running to prevent problems menu option is disabled (greyed out).
  1. Test: Before changing either development or production use this file for temporary testing.
  2. Development: Configuration file used for development. Errors will be written to the screen. You can enable other parameters for testing.
  3. Production: Configuration file for production ini file. Prevents errors being written to screen. The initial settings tighten security. For example, globals are off by default. Any changes you wish to be permanent should be made in this file.
PHP Basic configuration

Note 1: After making changes, click the corresponding update button. This writes the modified data to the associated configuration file.
Note 2: Changes to the current configuration are used next time the servers are started.
Note 3: For test, development and production configuration files to become effective, you need to select the appropriate file see and restart Apache.
Note 4: Do not enable short open tags. Doing so will conflict with other languages such as XML’s open tag. For detailed information, and the exception, see Short open tags

PHP Modules Enable/Disable

The following sub-menu allows you to enable or disable PHP extensions for the
currently selected PHP configuration file:

PHP > Edit Basic and Modules > PHP Modules Enable/Disable

Note: While Apache is running to prevent problems menu option is disabled (greyed out).

  • Checkbox un-checked Extension disabled
  • Checkbox checked Extension enabled

Note: After changing state you must restart the Apache server
for the new configuration to be recognised.

File modified:
File modified is the currently selected PHP configuration.

  • Current selected config is shown at the top for example:
  • PHP Version: php54
  • Config File: php_production.ini
PHP Extentions enable disable

PHP Accelerators

The Uniform Server Zero XI provides support for four PHP accelerators: eAccelerator, APC, Xcache and Zend OpCache. The following UniController sub-menu allows you to enable or disable these accelerators.

PHP > PHP Accelerators

Note: While Apache is running to prevent problems menu option is disabled (greyed out).

Selection:

  • Click PHP Accelerator you wish to use A), B), C) or D).
  • Previous selection is deselected and new selection enabled.
  • Selected PHP Accelerator is indicated by a check marker for example D).

Note 1: For the new settings to become effective you must restart the Apache server.

Note 2: A greyed out menu option indicates the accelerator is unavailable.

  • A) enables or disables eAccelerator. With the box checked, eAccelerator is enabled.
  • B) enables or disables APC. With the box checked, APC is enabled.
  • C) enables or disables Xcache. With the box checked, Xcache is enabled.
  • D) enables or disables Zend OptCache. With the box checked, Zend OptCache is enabled.
PHP Accelerators

View PHP Accelerator control panel

The Uniform Server Zero provides support for four PHP accelerators: eAccelerator, APC, Xcache and Zend OpCache. The following UniController sub-menu allows you to display the currently selected accelerator's controller in your default browser.

PHP > View PHP Accelerator control panel

Note: View PHP Accelerator control panel menu button greyed out indicates Apache and MySQL not running. The button is enabled when Apache and MySQL are running and PHP installed.

Accelerator control panel screen shots:

eAccelerator control panel:

eAccelerator is a free open-source PHP accelerator and optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated.

The Uniform Server Zero default installation has eAccelerator disabled.

The eAccelerator control panel is shown on the right.

eAccelerator control panel
APC control panel:

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It is a robust framework for caching and optimizing PHP intermediate code.

The Uniform Server Zero default installation has APC disabled.

The APC control panel is shown on the right.

APC control panel
Zend OptCache:

Zend OptCache provides faster PHP execution through opcode caching and optimization. It improves PHP performance by storing precompiled script bytecode in the shared memory.

The Uniform Server Zero default installation has Zend OptCache disabled.

The Zend OptCache control panel is shown on the right.

Zend OpCache control panel

--oOo--