Friday, June 13, 2008

Apache 2 + PHP 5 on Slackware 12

Installing Apache HTTP Server
  • tar zxvf httpd.tar.gz
  • cd httpd
  • ./configure --prefix=/usr/local/apache --enable-mods-shared=most --enable-deflate
  • make
  • make install
  • echo "/usr/local/apache/lib" >> /etc/ld.so.conf
  • ldconfig
For Apache to run at boot :
  • echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
Installing PHP 5
  • tar zxvf php.tar.gz
  • cd php
  • ./configure --prefix=/usr/local --with-config-file-path=/etc --with-apxs2=/usr/local/apache/bin/apxs --disable-debug --enable-memory-limit --enable-inline-optimization --enable-magic-quotes --enable-mbstring --enable-track-vars --enable-xml --with-dom --with-xml --enable-sockets --with-zlib --with-gettext --with-pear
  • make
  • make install
  • cp php.ini-recommended /etc/php.ini
Edit /etc/php.ini and do the following:
  • change "short_open_tag" to On
  • change include_path to ".:/usr/local/lib/php"
Edit /usr/local/apache/conf/httpd.conf and do the following:
  • add "LoadModule php5_module modules/libphp5.so"
  • add "index.php" to DirectoryIndex
Now, get back to your terminal and just run the following.
  • echo "application/x-httpd-php php" >> /usr/local/apache/conf/mime.types
  • sudo /usr/local/apache/bin/apachectl start

    Done.

No comments: