Tuesday, October 18, 2011

1and1 VPS, Step 3: PHP Configuration

During the update process, I noticed that the base CentOS image had PHP 5.3 installed. I am used to using PHP 5.2, so I hope that my web services work okay.
The web services and sites are a mix of Joomla, Wordpress, Drupal and a few custom websites. For these to be supported, I need to ensure that the relevant modules are installed. The PHP configuration also needs some modification for better security.

  1. Install additional php modules: 
    • yum install php-devel.x86_64 php-mcrypt.x86_64 php-tidy.x86_64 php-xmlrpc.x86_64
  2. Check and change configuration settings in php.ini:
    • safe_mode = off
    • disable_functions="dl,exec,fsockopen,passthru,pcntl_exec,pfsockopen,popen,posix_kill,posix_mkfifo,posix_setuid,proc_close,proc_open,proc_terminate,shell_exec,system"
    • memory_limit = 256M
    • max_execution_time = 120
    • max_input_time = 240
  3. Restart the httpd service: 
    • service httpd restart
I'll probably have to change the contents of the disable_functions for Joomla and Drupal. However, there may be some workarounds.

No comments:

Post a Comment