Difference between revisions of "LAMP"
(→Setting up a LAMP Server) |
(→Setting up a LAMP Server) |
||
Line 36: | Line 36: | ||
instead of this | instead of this | ||
''srclib/apr-util/config.status'':s,@APRUTIL_LIBS@,-lsqlite3 -lsqlite <font color=green>/usr/lib64/libexpat.la</font> ... | ''srclib/apr-util/config.status'':s,@APRUTIL_LIBS@,-lsqlite3 -lsqlite <font color=green>/usr/lib64/libexpat.la</font> ... | ||
− | The same is true for <tt>Makefile</tt> | + | The same is true for <tt>Makefile</tt>. |
* Step 3: Run <tt>make</tt> | * Step 3: Run <tt>make</tt> | ||
Line 63: | Line 63: | ||
* Step 2: <tt>make</tt> | * Step 2: <tt>make</tt> | ||
− | * Step 3: <tt>make install</tt> | + | * Step 3: <tt>make install</tt> (as superuser) |
* Step 4: Setup your <tt>php.ini</tt> | * Step 4: Setup your <tt>php.ini</tt> | ||
<pre>cp php.ini-dist /usr/local/lib/php.ini</pre> | <pre>cp php.ini-dist /usr/local/lib/php.ini</pre> |
Revision as of 08:08, 29 July 2006
LAMP usually refers to the following open source configuration:
In this article, I will only consider PHP for LAMP.
Contents
Setting up a LAMP Server
This section will only consider setting up a LAMP Server for SuSE Linux (tested on version 10.1) and with a 64-bit CPU / x86_64 (tested on a Pentium D processor).
Installing SuSE Linux
Note: Tested on version 10.1
under construction
Installing MySQL
see: MySQL
Installing Apache HTTP Server Version 2
Note: Tested on version 2.2.3
- Step 1: Configuration
./configure --enable-so --enable-mods-shared=expires,ssl,headers,http,info,rewrite
- Step 2: Fix built-in errors before running make
For some reason, there is a problem with Apache's default Makefile. It looks for lib64 in the wrong place. It is simple to fix this error.
The problem is found in the following two files: srclib/apr-util/config.status and srclib/apr-util/Makefile (note: both files are created after you run ./configure).
Note: If you perform the following search, you will clearly see the problem:
fgrep APRUTIL_LIBS srclib/apr-util/{config.status,config.log,Makefile}
The output from config.status will have this
srclib/apr-util/config.status:s,@APRUTIL_LIBS@,-lsqlite3 -lsqlite /usr/lib/libexpat.la ...
instead of this
srclib/apr-util/config.status:s,@APRUTIL_LIBS@,-lsqlite3 -lsqlite /usr/lib64/libexpat.la ...
The same is true for Makefile.
- Step 3: Run make
After fixing the above errors, you should now be able to successfully run make
- Step 4: make install (as superuser)
- Step 5: Test your installation
/usr/local/apache2/bin/apachectl start
Point your browser (ie, FireFox) to localhost and you should get a "It works!"
/usr/local/apache2/bin/apachectl stop(Important! Make sure you stop the server before installing PHP)
Installing PHP 5
Note: Tested on version 5.1.4
- Step 1: Configure (note: with my favourite includes)
./configure --with-apxs2=/usr/local/apache2/bin/apxs \ --with-mysql --with-mysqli=/usr/bin/mysql_config \ --with-zlib --with-pear --with-bz2 --enable-calendar \ --enable-exif --with-gd --with-ldap --enable-soap \ --with-xsl --enable-mime-magic --enable-expires \ --enable-headers --enable-ssl --enable-http --enable-info \ --enable-dir --enable-rewrite --enable-so --enable-isapi
- Step 2: make
- Step 3: make install (as superuser)
- Step 4: Setup your php.ini
cp php.ini-dist /usr/local/lib/php.ini
- Step 5: Add the following three lines to your httpd.conf (if they are not already present):
LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps