LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2007, 05:15 AM   #1
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Rep: Reputation: 15
Question PHP Installation


I have been trying to install PHP in my Linux Mandriva machine but am encountering problems.

The documentation first tells how to install Apache server (which I did successfully) followed by the PHP installation. After uncompressing the tar.gz PHP installation file, as per the installation instructions, I executed ./configure. The next step tells to run make but the following error gets generated when I run the make command:

make: *** No targets specified and no makefile found. Stop.

This is where I am getting stuck up. Can someone please help me resolve this problem?

Thanks,

Ron
 
Old 09-04-2007, 05:19 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 30
Did you encounter any errors while you've startet
the configure?

Is gcc compiler installed? gcc++ and so on?
 
Old 09-04-2007, 07:18 AM   #3
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks, mate, for your concern.

GCC compiler is installed but am not sure about GCC++. The only error that ./configure generates is this:

configure: error: xml2-config not found. Please check your libxml2 installation.

The above error gets generated at the very end.

Thanks once again,

Regards,

Ron
 
Old 09-04-2007, 08:13 AM   #4
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 30
So this is what you should fix first before you start any make
anytime.

configure: error: xml2-config not found. Please check your libxml2 installation

if you have got any package management system like synaptic or yum or yast search for something like xml2
installed it and start ./configure again.
 
Old 09-04-2007, 08:59 AM   #5
ingar
Member
 
Registered: Jan 2005
Location: Norway
Distribution: Fedora Core 7
Posts: 40

Rep: Reputation: 15
Short question: Do you need PHP for making/setting up a web-server?

If so, it might be interresting to check out this "ready-to-go" webserver-package - it will save you the trouble of getting all components installed, compiled and configured:

http://www.apachefriends.org/en/xampp-linux.html

I use this myself - and have been very satisfied with it. Only one important thing is, that you need to run the 'security'-setup afterwards.
 
Old 09-05-2007, 04:28 AM   #6
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks, friends, for your helpful suggestions.

Quote:
Short question: Do you need PHP for making/setting up a web-server?
Yes, thatīs exactly the reason why I need PHP - for setting up a web server.

Quote:
If so, it might be interresting to check out this "ready-to-go" webserver-package - it will save you the trouble of getting all components installed, compiled and configured:
Thatīs not a bad idea but itīs 51 MB size is the worrying factor for me! My ISP imposes a restriction on the size of the files downloaded.

Quote:
if you have got any package management system like synaptic or yum or yast search for something like xml2 installed it and start ./configure again.
How do I find out if my system has any packagae management system or not & if thereīs one, how do I find out the name of the package management system?

Actually when I open the Mandriva Control Centre & under the Software category, when I click Look at installable software and install software packages, among the many softwares installed, libxml2 is also listed as installed but when I search for libxml2 using Mandrivaīs in-built Find utility, it yields a directory named libxml2 which resides in the usr/include directory but thereīs no file any libxml2 in the libxml2 directory.

Any other suggestions, my dear friends?

Thanks once again,

Regards,

Ron
 
Old 09-05-2007, 05:08 AM   #7
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Friends, I could finally manage to install PHP after libxml2 was installed but I am not able to run PHP files in the browser (FireFox). Actually thereīs a tool named ASP2PHP which automatically converts ASP files to PHP files which is what I did but when I opened a PHP file in the browser (using Apache as the server), all I could see is just the source code of the PHP file.

Any ideas what could be causing this?

Thanks a lot friends for your helpful inputs.

Regards,

Ron
 
Old 09-05-2007, 06:50 AM   #8
dark_angel
Member
 
Registered: Oct 2006
Location: Bacolod, Philippines
Distribution: Slackware 12
Posts: 62

Rep: Reputation: 15
you should tell apache to feed all *.php files through PHP. try adding this line in your httpd.conf:

AddType application/x-httpd-php .php

good luck!
 
Old 09-05-2007, 03:26 PM   #9
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks, dark_angel, for your suggestion.

What you have suggested, the same is mentioned in the PHP installation help file but when I add the line

AddType application/x-httpd-php .php

in the httpd.conf file & then open a PHP file in FireFox, FireFox pops-up a dialog asking me whether I want to open the PHP file with KWrite or save the file to disk (the dialog that pops-up whenever one wants to download a file). But, as already said before, if I comment out the above line (in blue), then FireFox renders the source code of the PHP file.

What could be going wrong?

Also another step mentioned just before the above step in the help file says to add the following line in the httpd.conf file:

LoadModule php5_module modules/libphp5.so

where php5_module must point to the path of the PHP module on the system. I searched for libphp5 in my PC but could not find it. So using the Software Media Manager, I downloaded libphp5_common.so.5 (which got saved in the /usr/lib directory) & then ran the following command to create the symlink libphp5.so in the /usr/local/apache-2.2.4/modules directory:

ln -s /usr/lib/libphp5_common.so.5 /usr/local/apache-2.2.4/modules/libphp5.so

The symlink got created in the modules directory. Thatīs OK I suppose but when I searched for php5*, then surprisingly, the result yielded a directory named php4 (which exists in the /usr/lib directory) & not php5 (or any directory whose name is preceded by php5)! I guess this should be the path of the PHP module or am I wrong? If I am wrong, then how do I find out the path of the PHP module? Or the path of the PHP module is the directory in which the TAR PHP installation file was uncompressed??

Is something wrong? The reason I am asking this is because I downloaded the PHP-5.2.4 installation TAR file; so where did the directory php4 come from?

Also after PHP got installed successfully, the next step told to run make test but thereīs nothing given about make test in the help file. Can you throw some light on this?

Thanks once again,

Regards,

Ron
 
Old 09-05-2007, 07:26 PM   #10
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
PLEASE....SOMEBODY PLEASE HELP ME OUT! I have been trying to resolve this issue since last 4 days! My hairline has receded by 4 inches in these 4 days!

SO PLEASE HELP ME RESOLVE THIS PROBLEM....PLEASE.....ITīS AN EARNEST REQUEST.....

Thanks,

Regards,

Ron
 
Old 09-05-2007, 09:26 PM   #11
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Most of the articles & posts I have come across to resolve this issue says that the httpd.conf file should have the red colored line I have cited in my second-last post (the LoadModule line) but when I add that line in httpd.conf & then start the Apache server using

/usr/local/apache-2.2.4/bin/apachectl -k start

then the following error gets generated:

httpd: Syntax error on line 54 of /usr/local/apache-2.2.4/conf/httpd.conf: Cannot load /usr/local/apache-2.2.4/modules/libphp5.so into server: /usr/local/apache-2.2.4/modules/libphp5.so: cannot open shared object file: No such file or directory

Can someone please tell me what could be causing this error?

Thanks,

Regards,

Ron
 
Old 09-06-2007, 01:30 AM   #12
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
I finally managed to run PHP files using Apache in FireFox but please donīt ask me how! I myself am not sure how I could do it since I have employed so many methods to get a solution that now I donīt remember which method did the trick. Nevertheless some questions are still lingering in my mind. Can someone answer them?

The first few times when PHP scripts were not running, I configured both Apache & PHP using just ./configure without any flags. At this time, the root directory of PHP was usr/local/apache-2.2.4/htdocs. In other words, if a PHP file resided in the htdocs directory, I could access that PHP file with this URL:

http://localhost/Try.php

Itīs a different matter that I could just see the source code of the PHP file in the browser. The bottomline is the root was usr/local/apache-2.2.4/htdocs. The httpd.conf file resided in usr/local/apache-2.2.4/conf. In this file, PHP was told to listen to port 80. When I started Apache by executing the following command:

/usr/local/apache-2.2.4/bin/apachectl -k start

Apache used to start.

Since the PHP files were not running in the browser, I again configured Apache & PHP this time running ./configure with a host of flags like --with-apxs2=/usr/local/apache-2.2.4/bin/apxs, --with-apache-2.2.4=/usr/local/apache-2.2.4, --with-mssql=/usr, --with-mysql, --enable-ftp, --enable-ctype etc. for Apache and --enable-so, --enable-module=all, --enable-alias, --enable-asis, --enable-dir etc. for PHP. In fact, I did the configuration of Apache & PHP more than once using many flags but with slight differences here & there.

Now when I tried to start Apache by executing the above command (in blue), the following error got generated:

(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


After going through a no. of posts to overcome this error, I changed the Listen port in httpd.conf from 80 to some other port number. Now when I started Apache, it started successfully but strangely, usr/local/apache-2.2.4/htdocs which was the root directory earlier no longer remained the root directory. Rather the root directory changed to var/www/html. I discovered this change in root directory by running the PHP file Try.php (which resides in usr/local/apache-2.2.4/htdocs) in FireFox. The output was File not found since thereīs no file named Try.php in var/www/html but when I copied Try.php from usr/local/apache-2.2.4/htdocs to var/www/html, then the PHP file was rendered successfully in FireFox.

Actually thereīs another httpd.conf file which resides in etc/httpd/conf. I didnīt notice the existence of this httpd.conf file when I configured Apache & PHP without any flags; so I am not sure whether this httpd.conf file existed from the very beginning or not i.e. when I configured Apache & PHP for the first time without any flags or did this httpd.conf file get created after I configured Apache & PHP with the flags. But both the httpd.conf files had different values for the same directive like for e.g. the value of the directive DocumentRoot in the httpd.conf file which resides in usr/local/apache-2.2.4/conf is /usr/local/apache-2.2.4/htdocs whereas the value of this directive in the httpd.conf file existing in etc/httpd/conf is var/www/html. Similarly, the value of the directive ServerRoot in one of the httpd.conf files is /usr/local/apache-2.2.4 whereas the value of this directive in the other httpd.conf file is /etc/httpd.

Now which of the 2 httpd.conf files will Apache use to process PHP scripts? Also why are the values of the same directives in the 2 httpd.conf files different?

Moreover why did Apache generate the above error (in red) & refused to start when I configured Apache & PHP with a plethora of flags? Finally what could have prompted the root directory to change from usr/local/apache-2.2.4/htdocs to var/www/html?

Thanks,

Regards,

Ron
 
Old 09-06-2007, 05:48 AM   #13
dark_angel
Member
 
Registered: Oct 2006
Location: Bacolod, Philippines
Distribution: Slackware 12
Posts: 62

Rep: Reputation: 15
i'm not really sure about your apache having two httpd.conf. maybe you already have apache installed in your system before you even downloaded and installed a new one. what is your distro by the way? mine is slackware and it comes with apache and php already installed. my httpd.conf resides at /etc/httpd and my default htdocs directory resides at /var/www. one more thing, you mentioned that apache could not bind to port 80. its because port 80 is already taken by some other processes. maybe the previous apache?

please post whatever you have discovered. i'm very interested since i am also running an apache server in my laptop as a test server for my php scripts. although i haven't installed apache from scratch like you did.
 
Old 09-08-2007, 04:49 PM   #14
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
After installing MySQL, PHP scripts refused to run in FireFox. So I manually deleted all the files & directories related to Apache & PHP & installed them again in the same manner as I had done before (as stated in my last post) but again I am encountering the same error!

When I open a PHP file in FireFox, FireFox asks me whether I want open the file or save it in the hard drive! I just donīt understand where am I erring. I added the line

AddType application/x-httpd-php .php

in httpd.conf but, as already said, FireFox asks me whether I want to open the file or save it in the hard disk. If I remove the above line, then FireFox just displays the source code of the PHP files.

The PHP help file also says to add the following line in httpd.conf:

LoadModule php5_module modules/libphp5.so

I downloaded libphp5_common.so.5 (which got saved in the /usr/lib directory) & then ran the following command to create the symlink libphp5.so in the /usr/local/apache2/modules directory:

ln -s /usr/lib/libphp5_common.so.5 /usr/local/apache2/modules/libphp5.so

But when I start Apache, it generates the following error:

httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: php_register_internal_extensions

I have gone through numerous posts to resolve this issue & implemented each & every method I came across but the problem seems perennial.

Someone please help me resolve this problem....PLEASE....

Ron
 
Old 09-08-2007, 08:06 PM   #15
rn5a
Member
 
Registered: Aug 2007
Posts: 48

Original Poster
Rep: Reputation: 15
Can someone please give me a concrete solution?

PLEASE try to understand that itīs been close to 10 days since I have started installing LAMP & am still stuck up. When one works, the other doesnīt & vice-versa. I have gone through numerous posts & articles but still havenīt managed to get Linux-Apache-MySQL-PHP working together. I hope guys out there understand my frustration. Believe me - I am on the verge of losing my job!

PLEASE PLEASE PLEASE....I BEG YOU..SOMEBODY PLEASE HELP ME OUT....PLEASE....

Ron
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add options in php.in after installation of PHP? touqeeransar Linux - Software 1 11-30-2005 05:52 AM
PHP installation help Ghent Linux - Software 1 07-24-2005 03:19 AM
PHP installation herambshembekar Linux - Newbie 1 07-12-2002 01:28 PM
PHP Installation, Please Help sarmadys Linux - Software 1 01-19-2002 12:18 PM
php installation garorag Programming 1 10-10-2001 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration