Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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 installed apache and php on my debian server. But php does not work with apache. I added LoadModule php4_module /usr/local/src/php-4.3.7/libs/libphp4.so and LoadModule php4_module libexec/libphp4.so to the httpd.conf. Then I restarted apache.
When ever I run a php script on my server it still does not work. What am I missing. I have followed the debian tutorial and changed the path locations.
Originally posted by squirellplaying I installed apache and php on my debian server. But php does not work with apache. I added LoadModule php4_module /usr/local/src/php-4.3.7/libs/libphp4.so and LoadModule php4_module libexec/libphp4.so to the httpd.conf. Then I restarted apache.
php4.so files:
When ever I run a php script on my server it still does not work. What am I missing. I have followed the debian tutorial and changed the path locations.
EDIT: I could also not find a php.ini.
You do not mention the version you are using but in Sarge/SID it is a simple apt-get install php4 if you are using Woody the go to http://www1.apt-get.org/search.php?q...arch%5B%5D=all and add a line for one of the packages to your sources list and install it. Also in Sarge/SID the modules are in the file /etc/apache/modules.conf and it should be automatically updated when you install the php4 package.
Or if you want to continue with you using your source compiled version I believe you will have to edit the file /etc/ld.so.conf and add /usr/local/src/php-4.3.7/libs to the file and then run /sbin/ldconfig to have the ld.so.cache updated so the system would find the new libraries.
Thanks for the help so far. I am using Woody. I would like to continue using my source compiled because I am unsure of how to remove it to use apt-get. I did apt-get once but it didn't work either. The guy who was helping me told me to remove it and use a source compiled version. I editedthe file /etc/ld.so.conf and added /usr/local/src/php-4.3.7/libs to the file. Then I ran /sbin/ldconfig. Still no change. The guy who was helping me to set it up used a different file structure then the ones in the tutorial.
Originally posted by squirellplaying Thanks for the help so far. I am using Woody. I would like to continue using my source compiled because I am unsure of how to remove it to use apt-get. I did apt-get once but it didn't work either. The guy who was helping me told me to remove it and use a source compiled version. I editedthe file /etc/ld.so.conf and added /usr/local/src/php-4.3.7/libs to the file. Then I ran /sbin/ldconfig. Still no change. The guy who was helping me to set it up used a different file structure then the ones in the tutorial.
You can simply delete it is after all only in /usr/local and the packaging system will never know about anyways. I think you would be better off using a backport I posted the same link I believe yesterday for another person and they installed from one of the sites listed and it worked without a problem.
laggard:/usr/local/src# apt-get install php4
Reading Package Lists... Done
Building Dependency Tree... Done
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 583kB of archives. After unpacking 72.7kB will be freed.
Get:1 http://security.debian.org stable/updates/main php4 4:4.1.2-7.0.1 [583kB]
Fetched 583kB in 6s (85.7kB/s)
W: Couldn't stat source package list http://debian ./ Packages (/var/lib/apt/lists/debian_moolfreet.com_._Packages) - stat (2 No such file or directory)
(Reading database ... 17981 files and directories currently installed.)
Preparing to replace php4 4:4.1.2-6woody3 (using .../php4_4%3a4.1.2-7.0.1_i386.deb) ...
Unpacking replacement php4 ...
Setting up php4 (4.1.2-7.0.1) ...
W: Couldn't stat source package list http://debian ./ Packages (/var/lib/apt/lists/debian_moolfreet.com_._Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
I added the line deb http://debian.moolfreet.com ./ to the /etc/apt/sources.list. I did apt-get update but that gave me errors as well.
I installed on debian woody from source. Had the same problem with php not working. Ended up moving the php directory into apache2/htdocs/ and that solved the problem. I imagine there is a better way, or a symlink that could be made, but as it was working, I never bothered to explore it further.
I am having a similiar issue. I am running Debian Sarge using the 2.6.7 kernel with Apache 1.3.31 installed.
Apache runs fine all by itself but when I do an apt-get install php4 and then try to open a php file it wants me to download it. I have restarted apache countless times, I have verified that the LoadModule line is in there and the AddType lines are uncommented. I have matched it up with my Desktop's httpd.conf and modules.conf files and they are identical.
The only difference is my Desktop PCs had Apache 1.3.21 installed and then were upgraded to 1.3.31 (in my opinion this is the reason, but I have nothing to back it up). Does anyone have any success stories on clean installs with Apache 1.3.31?
I have tried both compiling the sources or using the binaries provided by Apache and PHP, plus the precompiled deb packages from Debian using apt-get. None of them worked.
Oh, and I am trying to use PHP 4.3.8 (sorry I forgot to mention that).
Matt
Originally posted by asb I installed on debian woody from source. Had the same problem with php not working. Ended up moving the php directory into apache2/htdocs/ and that solved the problem. I imagine there is a better way, or a symlink that could be made, but as it was working, I never bothered to explore it further.
Unfortunatly I don't think that will work with me. I had someone help me set up so the file locations are different anyway.
Okay, I think I solved the issue, but it took me forever to do.
First you need to run the following:
apt-get remove apache apache-common apache-utils php4 php4-mysql mysql-server mysql-common libmysqlclient10 libdbd-mysql-perl --purge
Pretty much remove everything related to apache, php, and mysql. Even the configuration files.
Then run:
apt-get install apache apache-common php4 php4-mysql mysql-server mysql-common libmysqlclient10 libdbd-mysql-perl
Hopefully when it finishes the install it will not say any errors regarding "invoke-rc.d: unknown initscript, /etc/init.d/{packagename} not found".
If you receive that message, remove all packages associated with the package it whines about.
I did this after screwing around with my laptop for nearly 5 hours and so I do not recall every step I took, but these were the ones that just worked in the last 10 minutes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.