LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   PHP/Apache/Debian (https://www.linuxquestions.org/questions/linux-general-1/php-apache-debian-212985/)

squirellplaying 08-03-2004 01:05 PM

PHP/Apache/Debian
 
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:
Quote:

debian:~# locate libphp4.so
/usr/local/apache/libexec/libphp4.so
/usr/local/src/php-4.3.7/.libs/libphp4.so
/usr/local/src/php-4.3.7/libs/libphp4.so
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.
Quote:


debian:~# locate php.ini
/usr/local/src/php-4.3.7/pear/tests/php.ini
/usr/local/src/php-4.3.7/php.ini-dist
/usr/local/src/php-4.3.7/php.ini-recommended

HappyTux 08-03-2004 02:26 PM

Re: PHP/Apache/Debian
 
Quote:

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.

squirellplaying 08-03-2004 02:41 PM

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.

HappyTux 08-03-2004 03:08 PM

Quote:

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.

The Thread: http://www.linuxquestions.org/questi...hreadid=212674

squirellplaying 08-03-2004 04:25 PM

Ugg. I got more errors.
Quote:

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.
Quote:

laggard:/usr/local/src# apt-get update
Err http://debian ./ Packages
Could not resolve 'debian'
Hit http://ftp.us.debian.org stable/main Packages
Hit http://ftp.us.debian.org stable/main Release
Hit http://ftp.us.debian.org stable/main Sources
Hit http://ftp.us.debian.org stable/main Release
Hit http://ftp.us.debian.org stable/main Packages
Hit http://ftp.us.debian.org stable/main Release
Hit http://ftp.us.debian.org stable/main Sources
Hit http://ftp.us.debian.org stable/main Release
Hit http://security.debian.org stable/updates/main Packages
Hit http://security.debian.org stable/updates/main Release
Err http://debian ./ Release
Could not resolve 'debian'
Hit http://non-us.debian.org stable/non-US/main Packages
Hit http://non-us.debian.org stable/non-US/main Release
Hit http://non-us.debian.org stable/non-US/main Sources
Hit http://non-us.debian.org stable/non-US/main Release
Hit http://non-us.debian.org stable/non-US/main Packages
Hit http://non-us.debian.org stable/non-US/main Release
Hit http://non-us.debian.org stable/non-US/main Sources
Hit http://non-us.debian.org stable/non-US/main Release
Failed to fetch http://debian/moolfreet.com/./Packages Could not resolve 'debian'
Failed to fetch http://debian/moolfreet.com/./Release Could not resolve 'debian'
Reading Package Lists... Done
Building Dependency Tree... Done
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: 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
E: Some index files failed to download, they have been ignored, or old ones used instead.
Here is the source list. I don't see anything wrong with it.
:confused:

comp12345 08-03-2004 05:09 PM

Should
Code:

deb http://debian/moolfreet.com ./
be
Code:

deb http://debian.moolfreet.com ./
or is that a typo?

HappyTux 08-03-2004 05:10 PM

Quote:

Originally posted by squirellplaying
Ugg. I got more errors.


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.


Here is the source list. I don't see anything wrong with it.

:confused:

There is a typo in your line it should be.


squirellplaying 08-03-2004 05:34 PM

Ugg. You are correct. It was a typo. I installed php4. I went into the httpd.conf and updated it with the new paths to php4.so.
Code:

LoadModule php4_module /usr/local/apache/libexec/libphp4.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

Then restarted apache.

I still get nothing on my php test page.

asb 08-03-2004 06:35 PM

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.

cpradio 08-03-2004 07:51 PM

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

squirellplaying 08-03-2004 09:12 PM

Quote:

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.

cpradio 08-04-2004 12:10 AM

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.

Matt

squirellplaying 08-04-2004 02:20 PM

Well I would rather not remove apache just to reinstall it. I'm sure I'm just missing some line for php somewhere.

cpradio 08-04-2004 02:22 PM

Well then try running this then:
apt-get install apache apache-common php4 php4-mysql mysql-server mysql-common libmysqlclient10 libdbd-mysql-perl --reinstall

squirellplaying 08-04-2004 07:46 PM

Doesn't that still just reinstall it?


All times are GMT -5. The time now is 06:23 AM.