Configuring the PHP installation

From phpCMS

Jump to: navigation, search

[edit] Configuring the PHP installation

This part of the documentation is only important for administrators of own webservers!

The programming language PHP was developed especially for programming web applications. That is the reason why it is perfectly suitable to be used in a content management system like phpCMS. PHP is an interpreted script language, which means that applications which are written in PHP are not precompiled. Whenever a PHP script is called, the PHP interpreter is loaded and the PHP script is executed line by line.

Therefore a PHP interpreter has to be installed on the webserver, in order to be able to run PHP applications. There are two common ways, how the PHP interpreter can be executed on a webserver. The first way is to executete the PHP interpreter via the so called 'CGI-interface' as a stand-allone programm, which is run by the webserver, whenever a PHP script has to be parsed. The second way is to plug the PHP interpreter as a module directly into the Apache webserver (which is obviously only applicable if the Apache webserver is used)

In principle both variants have their pros and cons. However an enumeration of all those would go beyond the scope of this documentation. One of the main differences between the two possibilities is the speed. Of course the especially for a webserver adapted module-version is faster than the CGI-version as it resides in the memory, while the CGI-version has to be loaded and startet every time a PHP script is accessed. Nevertheless the main advantage of the CGI-version is, that it can be run on the command-line layer of the OS. phpCMS uses this capability in the "Shell-Indexer". Hence it is convenient to have both variants available on your system.

The PHP interpreter can be extended by additional modules as well. There is a huge variety of optinal PHP modules available, for example modules with special graphic-functions as well as functions that facilitate the work with various databases. phpCMS was intentionally programmed so it does not require any of those additional modules. That fact permits the use of phpCMS also on servers that have only a few or even no additional PHP modules loaded.

The PHP standard-configuration already permits the use of phpCMS. The configuration then is done completely via the php.ini - file. Since a few versions of PHP the variable register_globals is by default set to off. Versions of phpCMS before 1.1.9 were not able to work with this configuration. However in current versions that fact does not exist anymore but there are still some older plugins for phpCMS that probably won't work correctly with this default setting. We recommend to leave the the variable set to off, unless you use scripts or plugins which require this variable set to on.

The LAMP/WAMP distributions as well as most of the bigger Linux distributions do so. All known providers have also changed that setting compared to the standard.

The previously mentioned setting should increase the security of PHP programmed web-applications. The following setting has the same aim. The Safe Mode also serves for increasing the security of PHP. In that mode the rights of programs running under PHP are being restricted which unfortunately often causes complications -- even in context with phpCMS. Whenever it is possible one should renounce on that secure mode. Some of the big providers have activated the Safe Mode so that parts of phpCMS do not work properly. However the reason for this is not the inability of our developers but the massive restriction of rights that are granted to an web-application. Especially when using the File Manager lots of error messages will occur. Unfortunately the modules Statistic and Spider do not work in Safe Mode. The cause for that is that those two modules want to create files on the webserver, which is not allowed.

Here is a detail from the php.ini - file with the suggested settings:

 ...
 register_globals=Off
 ...
 safe_mode=Off
 ...

One could write a whole book about the configuration of PHP and the connected problems. We confined ourselves to a very little part of the settings. There are of course further possibilities to increase the security or speed of PHP. The aim of this passage however was to help avoiding problems that might occur when using phpCMS. In case of nevertheless arising problems the phpCMS-Forum for installation support might be useful. If there are problems with special settings that occur more often, we certainly will add them to the documentation.

Main Page: User Documentation MainPage
« Previous Page: Configuring the web server | Top Page: Installation and configuration | Next Page: Extract the files »

Personal tools