06-04-2005, 12:31 PM | #1 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
Linux/Apache/PHP Problems
Having a few issues with my server box, running Debian Testing. It used to have Apache 2 on it. A couple of days ago, I decided to move that to Apache 1, just because Im more comfortable with it. I go to apt-get uninstall it, and it wont. Says it isnt installed--but I know for a fact it is, Ive been using it to serve a few webpages for a while. After tinkering with that to no avail, I just decide to go ahead and install Apache 1 and go from there. I do it, and immediately am getting problems--very slow, PHP errors all over, the works. So I uninstall PHP and reinstall, and since then, have been unable to get PHP working again. Everytime, it tries to download the PHP page, rather than serve it up like normal. Ive tried uninstalling and reinstalling several times, poked through httpd.conf several times and didnt see anything wrong, and everything that I could think of, to no avail. Ive never had problems like this before--always just apt-get installed apache then php, and it worked.
Any suggestions?
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
06-04-2005, 11:23 PM | #2 (permalink) |
In Your Dreams
Location: City of Lights
|
Multiple ideas here, probably no useful ones
#1) Did you use apache or httpd as the name when apt-get uninstalling or whatever? I think apache 2 is (officially) referred to as httpd, as the apache group has many projects. #2) I'm not too familiar with debian packages, but I'm guessing there's the ability to list all the packages installed on the system (with rpms, it's rpm -qa). Can you just <whatever> | grep http or <whatever> | grep apache, to see what it says? Then apt-get uninstall <results from grep>. #3) I believe httpd/apache has to be started with the -DPHP4 (or -DPHP5) option to handle PHP stuff. Well, on the Gentoo box that I had I had to do that. The Fedora box I'm on now doesn't seem to have that option set and it handles php fine, so.. I dunno (although I think the gentoo was apache1 and this fedora box is apache2). Like I said, a few ideas.. probably none useful . |
06-05-2005, 12:27 AM | #3 (permalink) |
Junkie
|
If it's downloading the PHP code instead of running the script, it sounds like Apache doesn't have a MIME type handler for PHP. Since you installed PHP separately this time, you may have installed it as an executable instead of an Apache module. In that case, Apache must be told to pass PHP files to the executable. Check your apache.conf file to see if it is handling PHP files correctly.
Last edited by SinisterMotives; 06-05-2005 at 12:29 AM.. |
06-05-2005, 05:24 AM | #4 (permalink) |
Professional Loafer
Location: texas
|
SinisterMotives, when you use apt in Debian to install PHP3/4 with apache, it just works. It compiles everything for you each time you install something (ie. php4-gd, php4-mysql) to work with the current working version of Apache.
Latch, in Debian, you don't have to do anything special to get php loading with apache. It sets this up automatically and you can remove the functionality afterwards if needed. In Debian, the Apt names are apache and apache2, not httpd. Sailor, see if you have a program on there called "aptitude". It's much better than apt-get as far as managability and functionality. If you're using sarge (testing, very soon to be stable as 3.1), it should be on there automatically. Try doing "aptitude update", let is pull the update info from apt-get and then try doing "aptitude search apache2". The package name as far as I know is just "apache2", not something like "apache2-server". Do an "aptitude remove apache2". What does it say? I would uninstall php4 ("aptitude remove php4, plus any extensions you have installed) and apache2, then reinstall apache and php4. If it's still not working, do "aptitude" by itself and go into the visual part of it. It will show you everything that is installed notated by an "i" next to the package. I'm not sure where apache2 is in the list, but should be quite easy to find. You use + to install and - to remove packages. The info on how to use it is at the top of the aptitude program. If all else fails, I would be happy to SSH into your box if needed and help you out.
__________________
"You hear the one about the fella who died, went to the pearly gates? St. Peter let him in. Sees a guy in a suit making a closing argument. Says, "Who's that?" St. Peter says, "Oh, that's God. Thinks he's Denny Crane." |
06-05-2005, 09:59 AM | #5 (permalink) |
Insane
Location: Austin, TX
|
Its problems like this that have made me totally hate most packaging systems. In a pinch, I like slackware packages because they're just simple .tar.gz packages of the binaries I want.
But in general I prefer just downloading the sources and building them myself. |
06-05-2005, 12:53 PM | #6 (permalink) |
Professional Loafer
Location: texas
|
skaven: tar.gz packages aren't just slackware packages (though you probably know this). And too, if you use some of the packaging systems, they auto-resolve dependencies for you.
Debian's apt repository and gentoo's emerge system are far superior than anything else out there.
__________________
"You hear the one about the fella who died, went to the pearly gates? St. Peter let him in. Sees a guy in a suit making a closing argument. Says, "Who's that?" St. Peter says, "Oh, that's God. Thinks he's Denny Crane." |
06-06-2005, 11:05 AM | #7 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
Woo! OK, turns out I hadnt removed one PHP package (php-gd), and once I found and removed that and reinstalled it all, it worked. Now if I could just figure out what's keeping wordpress from working...
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
06-06-2005, 12:35 PM | #8 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
Or... Not. This is weird. Certain things are connecting and working fine (phpmyadmin), but other things wont connect to the database--wordpress and several other things I have written. Coming back saying mysql_connect() is an undefined function, implying something is up with php4-mysql--but phpmyadmin works. Im totally confused... any suggestions?
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
06-06-2005, 12:55 PM | #9 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
And its working, again. For some reason, despite aptitude telling me that php4-mysql was installed, it seems like it wasnt. I apt-get installed it, and everything started working just fine. Very, very strange.
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
06-06-2005, 01:13 PM | #10 (permalink) |
Professional Loafer
Location: texas
|
what happens if you go into phpmyadmin and click on the php info link.......does it show the version of php and what you have compiled into it?
__________________
"You hear the one about the fella who died, went to the pearly gates? St. Peter let him in. Sees a guy in a suit making a closing argument. Says, "Who's that?" St. Peter says, "Oh, that's God. Thinks he's Denny Crane." |
06-06-2005, 01:43 PM | #11 (permalink) |
beauty in the breakdown
Location: Chapel Hill, NC
|
Yep. phpinfo() and phpMyAdmin were working fine, but nothing else (as far as I could see) that used php/mysql functions was working. Very strange.
__________________
"Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." --Plato |
06-08-2005, 08:47 AM | #12 (permalink) |
Crazy
Location: Salt Town, UT
|
In the future, if you are having problems with a debian package there are three standard steps you should take (each more drastic than the last). In these examples, replace <package> with the package name.
1. dpkg-reconfigure <package> This will reconfigure the package, and ask you the configuration questions about the package again. With the PHP modules, it will check the php.ini files, and make sure that it is properly installed in each one of them. 2. apt-get --reinstall install <package> This will reinstall the package, downloading it if necessary, and unpacking and installing just as if you were upgrading to that version. 3. dpkg --purge <package> ; apt-get install <package> CAUTION: This will remove all configuration files for this package. Any custom modifications to the configuration files will be destroyed. This will totally remove, and then reinstall the package. Only use this as a last-case resort, because you will also have to remove all packages that depend on the package you are reinstalling. |
Tags |
linux or apache or php, problems |
|
|