Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have configured and installed as per directions successfully, but I am unable to view PHP or HTML webpages. Seems like I am missing some small thing.
These are the details of my LAMP Stack. I have attached my httpd.conf hereby.
Thanks for your precious time. I did as per your instruction, I get following error
Code:
[root@server bin]# ./apachectl restart
./apachectl restart: httpd not running, trying to start
Syntax error on line 223 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp5.so into server: /usr/local/apache/libexec/libphp5.so: cannot open shared object file: No such file or directory
./apachectl restart: httpd could not be started
The problem is that I dont have this file
Code:
[root@server libexec]# ls -lrth /usr/local/apache/libexec/libphp5.so
ls: /usr/local/apache/libexec/libphp5.so: No such file or directory
I tried google on this, as per this link, I found these three lines are necessary in /usr/local/apache/conf/httpd.conf
and got the below message after the ./configure stopped executing.
Code:
Thank you for using PHP.
Notice: Following unknown configure options were used:
--enable-mm=shared
--enable-track-vars
--enable-trans-sid
--with-dom
--with-xml
Just another update. I just compiled PHP again, and now things are somewhat working for me.
Now, I am unable to open index.php (again getting the same dialog box with "save to disk" or "open with" options.
BUT able to open index.html (or index.htm) which has php codes in it.
Please see the below output.
Code:
[root@server htdocs]# curl "http://server.red.com/index.php"
<?php
phpinfo();
?>
<? print(Date("l F d, Y")); ?>
[root@server htdocs]#
[root@server htdocs]# curl "http://server.red.com/index.html"
<html>
<head>
<title>Example #1 TDavid's Very First PHP Script ever!</title>
</head>
HELLO WORLD
Sunday April 25, 2010
<body>
</body>
</html>
[root@server htdocs]#
[root@server htdocs]# curl "http://server.red.com/index.htm"
<html>
<head>
<title>Example #1 TDavid's Very First PHP Script ever!</title>
</head>
HELLO WORLD
Sunday April 25, 2010
<body>
</body>
</html>
[root@server htdocs]#
Contents of index.html and index.php are :
Code:
[root@server htdocs]# cat index.php
<?php
phpinfo();
?>
<? print(Date("l F d, Y")); ?>
[root@server htdocs]#
[root@server htdocs]# cat index.html
<html>
<head>
<title>Example #1 TDavid's Very First PHP Script ever!</title>
</head>
HELLO WORLD
<? print(Date("l F d, Y")); ?>
<body>
</body>
</html>
[root@server htdocs]#
I believe my apache is not recognizing .php pagesbut is able to execute php codes in .html pages. I am attaching my new httpd.conf hereby.
Last edited by vikas027; 04-25-2010 at 01:17 AM.
Reason: Forgot the attachement
Here are some things to look after:
1. You don't need the "AddModule mod_php5.c" as the php module is compiled as a DSO.
2. I've already told you to remove .htm .html from the "AddType..." directive. You don't want to parse html as php
3. The AddHandler is not really needed
4. Take a look at the apache error_log
5. If you want to use php code in a html page, you have to give the .php extension to the page. Now it works because of the #2 above, but it's not correct.
BTW, why do you want to use apache 1.3.x and not apache 2.2.x?
Finally, it worked for me. I believe the problem was due to package versions inter-operability.
I owe you a beer mug
My sincere thanks to you to help me get this working.
Now, I will try mysql connectivity with PHP and try to build a test website using php pages.
For other poor chaps like me who are having problems with LAMP, this might help them.
Finally, it worked for me. I believe the problem was due to package versions inter-operability.
I don't think it was a version inter-operability problem. I was able to build apache 1.3.x with php5 support in the past without problems. I think it was something in the configuration that we overlooked (probably the AddHandler directive because the rest is needed).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.