LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
LinkBack Search this Thread
Old 08-03-2004, 01:05 PM   #1
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Rep: Reputation: 15
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
 
Old 08-03-2004, 02:26 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 62
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.
 
Old 08-03-2004, 02:41 PM   #3
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
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.
 
Old 08-03-2004, 03:08 PM   #4
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 62
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
 
Old 08-03-2004, 04:25 PM   #5
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
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.

Last edited by squirellplaying; 08-03-2004 at 04:26 PM.
 
Old 08-03-2004, 05:09 PM   #6
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
Should
Code:
deb http://debian/moolfreet.com ./
be
Code:
deb http://debian.moolfreet.com ./
or is that a typo?
 
Old 08-03-2004, 05:10 PM   #7
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 62
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.

There is a typo in your line it should be.

 
Old 08-03-2004, 05:34 PM   #8
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
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.

Last edited by squirellplaying; 08-03-2004 at 05:35 PM.
 
Old 08-03-2004, 06:35 PM   #9
asb
Member
 
Registered: Jul 2003
Location: portland
Distribution: debian testing
Posts: 68

Rep: Reputation: 15
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.
 
Old 08-03-2004, 07:51 PM   #10
cpradio
LQ Newbie
 
Registered: Aug 2004
Posts: 3

Rep: Reputation: 0
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
 
Old 08-03-2004, 09:12 PM   #11
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
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.
 
Old 08-04-2004, 12:10 AM   #12
cpradio
LQ Newbie
 
Registered: Aug 2004
Posts: 3

Rep: Reputation: 0
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
 
Old 08-04-2004, 02:20 PM   #13
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
Well I would rather not remove apache just to reinstall it. I'm sure I'm just missing some line for php somewhere.
 
Old 08-04-2004, 02:22 PM   #14
cpradio
LQ Newbie
 
Registered: Aug 2004
Posts: 3

Rep: Reputation: 0
Well then try running this then:
apt-get install apache apache-common php4 php4-mysql mysql-server mysql-common libmysqlclient10 libdbd-mysql-perl --reinstall
 
Old 08-04-2004, 07:46 PM   #15
squirellplaying
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Rep: Reputation: 15
Doesn't that still just reinstall it?
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian + Apache + PHP + MySQL.so = Error critical Linux - Software 4 08-04-2005 04:18 AM
Debian, Apache, PHP, MySQL rossp Linux - Software 2 10-30-2004 06:51 AM
Debian + Apache + PHP keripukki Linux - Networking 1 10-16-2004 04:35 PM
Apache with PHP under Debian TemplaraPheonix Linux - Software 0 07-01-2004 12:36 AM
Apache / PHP / Mysql config problem - debian bandit Linux - Software 14 09-03-2003 09:04 AM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration