Enabling PHP for Apache server on my Laptop

Hello I am a novice when it comes to computers in general.With a great amt of help from this forumn I have been able to intstall Apache
on my laptop .I have no problem with the http server and I have been using it for Perl CGI for some time.
I have the httpd in my /etc/httpd/

I am trying to install and enable PHP ..following this
I installed php4 in

Following the previous post here I serached for

I followed a post on this site ..which directed me to look for
LoadModule php4_module  libexec/libphp4.so
and add
AddType application/x-httpd-php .php

I looked for "LoadModule php4_module  libexec/libphp4.so" for that in httpd.conf but could not find it ...So
I added the lines
LoadModule php4_module  libexec/libphp4.so
AddType application/x-httpd-php .php
and ran the httpd server again
I get the following error
Cannot load /etc/httpd/libexec/libphp4.so into server: /etc/httpd/libexec/libphp4.so: cannot open shared object file: No such file or directory

Thanks for your time....I appreciate it
Who is Participating?
yuzhConnect With a Mentor Commented:
Have you installed?

Pleasse have a look at the instructions in the following doc, and try
to download php (binary package) or download php source code
complie and install it:


In case you need more help, please remember post the information
about your OS.

It is very late now (Australian time), good night.
The problem is " LoadModule php4_module  libexec/libphp4.so" the bug in the php installation

it should looks like:
 LoadModule php4_module        /usr/apache/libexec/libphp4.so

type in the following command in your system:
        find / -name "libphp4.so" -type f
to locate the full path of the file and then modify your httpd.conf file.

You also need to modify your httpd.conf file and to make sure you have:
(search" php" and edit)

AddModule mod_php4.c

<IfModule mod_dir.c>
#    DirectoryIndex index.html
    DirectoryIndex index.html index.php index.php3 index.php4 index.htm index.shtml index.cgi

    # And for PHP 4.x, use:
    AddType application/x-httpd-php .php

when you edit the httpd.conf, just do a search for php to see what the installation script
has added for you, and fix the error if any.

micro_learnerAuthor Commented:
Hello thanks for the reply but when I searched for the libphp4.so I did not find it in my system..please direct me on this
micro_learnerAuthor Commented:
Thanks the error was ..that some how the php was not installed properlly had to install it afresh...
Thanks agian
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.