&nsp;  Documentation Home

 

INSTRUCTIONS FOR COMPILING APACHE/PHP/MYSQL on RedHat Linux V8/9

 

*note: these instructions are for an older version of PHP/MySQ:L and Apache, but the process is the same.

You simply must use the lastest packages of each (provided you have an up to-date linux kernel!)

Set the path

bash> export PATH=/usr/local/bin:/usr/local/lib:/usr/local/libexec:/usr/local/etc:/usr/local/sbin:/usr/local/mysql:$PATH

Unzip and UnTAR the source code for Apache 1.3.27
and PHP-4.3.1 and MySQL 3.23.58

[user@somesystem]# cd mysql-3.23.58

[mysql-3.23.58]# ./configure --prefix=/usr/local/mysql >> configure.out 2>&1

now you can view the output later!

[mysql-3.23.58]# make

[mysql-3.23.58]# make install

MySQL is now installed!

[mysql-3.23.58]# mysql_install_db

[mysql-3.23.58]# chown -R mysql:mysql /usr/local/mysql

[mysql-3.23.58]# chmod -R 775 /usr/local/mysql

[mysql-3.23.58]# cd /usr/local/mysql/bin; ./safe_mysqld &

[/usr/local/mysql/bin]# mysqladmin -u root -h <hostname> password 'somepassword'

[/usr/local/mysql/bin]# mysql -u root -p
enter password: ********
mysql>

mysql> show databases

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 74 to server version: 3.23.58-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases ;

+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.00 sec)

...

mysql> exit
bye
[/usr/local/mysql/bin]#

[user@somesystem]# cd <dir>/apache_1.3.27

[apache_1.3.27]# ./configure

[apache_1.3.27]# cd ../php-4.3.1

[php-4.3.1]# ./configure --with-apache=../apache_1.3.27 --with-mysql=/usr/local --enable-track-vars

*note: this is assuming you install MYSQL in /usr/local


You will know PHP is configured Correctly when you see:

+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
| *** NOTE *** |
| The default for register_globals is now OFF! |
| |
| If your application relies on register_globals being ON, you |
| should explicitly set it to on in your php.ini file. |
| Note that you are strongly encouraged to read |
| http://www.php.net/manual/en/security.registerglobals.php |
| about the implications of having register_globals set to on, and |
| avoid using it if possible. |
+--------------------------------------------------------------------+


[php-4.3.1]# make

[php-4.3.1]# make install

[php-4.3.1]# cd ../apache_1.3.27

[apache_1.3.27]# ./configure --activate-module=src/modules/php4/libphp4.a

*note: The libphp4.a does not exist, but will show in the second line (or so)
+activated php4 module (modules/php4/libphp4.a)

Now we know php will be compiled into Apache

[apache_1.3.27]# make

[apache_1.3.27]# make install


+--------------------------------------------------------+
| You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /usr/local/apache/conf/httpd.conf |
| |
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| |
| /usr/local/apache/bin/apachectl start |
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+--------------------------------------------------------+


Now, Append the following lines to the bottom of the httpd.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .phtm
AddType application/x-httpd-php-source .phps


Don't forget to change the ServerName, the DirectoryIndex, and the DocumentRoot directives.
Be sure the directory index contains index.php and *.php


Create a file called /usr/local/apache/htdocs/index.php and put <? phpinfo(); ?> in the file.

Congrats!

============================================================

To Install phpMyAdmin

1. Untar or unzip the distribution (be sure to unzip the
subdirectories): tar -xzvf phpMyAdmin_x.x.x.tar.gz in your
webserver's document root.(/usr/local/apache/htdocs )
If you do not have direct access to your
document root, put the files in a directory on your local machine,
and, after step 3, transfer the directory on your web server
using, for example, ftp.

2. Open the file config.inc.php in your favorite editor and change
the values for host, user, password and authentication mode to fit
your environment. Here, "host" means the MySQL server. Also insert
the correct value for $cfg['PmaAbsoluteUri']. Have a look at
Configuration section for an explanation of all values.

PmaAbsoluteUri should be the fully qualified path: ex. /usr/local/mysql

3. It is recommended that you protect the directory in which you
installed phpMyAdmin (unless it's on a closed intranet, or you
wish to use HTTP or cookie authentication), for example with
HTTP-AUTH (in a .htaccess file). See the multi-user sub-section of
the FAQ for additional information, especially FAQ 4.4.

4. Open the file <www.your-host.com>/<your-install-dir>/index.php in
your browser. phpMyAdmin should now display a welcome screen and
your databases, or a login dialog if using HTTP or cookie
authentication mode.