PHP

From ArchWiki
Revision as of 10:17, 5 May 2007 by Aquila deus (Talk | contribs) (New page: === Server setup === ==== Zend Core + Apache ==== * Install [http://aur.archlinux.org/packages.php?do_Details=1&ID=10577 mod_fcgid], a FastCGI module for apache (the official one sucks). *...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Server setup

Zend Core + Apache

  • Install mod_fcgid, a FastCGI module for apache (the official one sucks).
  • Install Zend Core (official php distribution)
    • Uninstall arch linux's php package.
    • Download and install zend core from http://www.zend.com/products/zend_core ; don't install the bundle apache or tell it to setup your web server. It always installs to /usr/local/Zend/Core due to hard-coded path.
    • Create a script /usr/local/bin/zendcore and create symlinks to php, php-cgi, pear, phpize under /usr/local/bin
      #!/bin/bash
      export LD_LIBRARY_PATH="/usr/local/Zend/Core/lib"
      exec /usr/local/Zend/Core/bin/`basename $0` "$@"
  • Setup Apache:
    • In /etc/httpd/conf/httpd.conf, add
      LoadModule fcgid_module lib/apache/mod_fcgid.so
      AddHandler fcgid-script .php
      FCGIWrapper /usr/local/bin/php-cgi .php
      SocketPath /tmp/fcgidsock
      SharememPath /tmp/fcgidshm
  • Disable Zend Optimizer (so you can use cache):
    • Edit /etc/php.ini, uncomment the following line near the end of file:
      zend_extension_manager.optimizer="/usr/local/Zend/Core/lib/zend/optimizer"
  • Install APC (Alternative PHP Cache):
    • Run pear install pecl.php.net/apc as superuser.
    • Edit /etc/php.ini, add the line after "; Zend Core extensions..." (line 1205):
      extension=apc.so