LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 02-11-2005, 04:10 AM   #1
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
PHP files unrecognized by Apache after upgrade -- Need help reconfiguring


I recently did an Apache 2.0 upgrade via synaptic. Once upgraded, PHP files were no longer recognized.

So I removed and reinstalled Apache 1.3.3 and reinstalled the PHP-module for Apache 1.x after removing 2.0.

But PHP files continue to be unrecognized by the Apache webserver. The browser tries to download them like a binary file and not render them as web pages. Is there any way to get back PHP files rendering by Apache? What config file do I need to edit to get it back running again.

I tried removing the config files and reinstalling a fresh version. But it doesn't seem to help.

Anybody who can tell me which files to edit to get back PHP support? I have the Apache Modules for PHP installed. I just want to know how to reconfigure Apache 1.x to load the module at startup.

Thanks.
 
Old 02-12-2005, 08:27 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Edit /usr/local/apache2/conf/httpd.conf (on my Rh9 system, at least) and add this in the "AddType" section:

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

and also in the modules section:

/usr/local/apache2/modules/libphp4.so

Find these section my simply searching for "AddType" and "Modules" in the httpd.conf file.

Restart Apache (/usr/local/bin/apachectl stop then /usr/local/bin/apachectl start) and you should have PHP files recognized and processed once again.
 
Old 02-12-2005, 09:05 AM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Thanks rylan!

Strangely after a couple of reinstallations I got it working fine. Now there is another problem.

Now PHP says that mysql_connect() command is unrecognized.

Code:
Fatal error: Call to undefined function: mysql_connect() in /var/www/brotherhood_forum/index.php on line 24
This code was working fine before I did the upgrade and now the PHP file (unmodified since that time) gives this error?

Do you think I messed up mysql somewhere? What do you suggest?
 
Old 02-12-2005, 11:25 PM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Never mind. I solved both problems.

It was a setting in php.ini where the mysql module was not loaded by default. Now it's solved.
 
Old 04-16-2005, 03:52 PM   #5
Dr3n
Member
 
Registered: Feb 2005
Posts: 60

Rep: Reputation: 16
That's so weird, I just had the EXACT same issue. But thanks to this thread (and site) I resolved the problem within minutes. Crazy Linux, always keeping us on our toes.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Reconfiguring PHP for Suse 9.2 harshnoise Linux - Software 1 08-15-2005 10:48 AM
Help fixing/reconfiguring PHP on Apache PolishSausageof Linux - Software 1 04-28-2005 09:54 AM
Problem after an upgrade to php 5.0.1 and Apache 1.3.31 NothingHere Linux - Software 1 09-14-2004 06:24 AM
reconfiguring squid via PHP gimme5 Linux - Networking 0 09-09-2001 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration