PHP5 + MySQL gives Internal Server Error

Posted on 2008-06-23
Last Modified: 2013-12-13
I get an HTTP 500 Internal Server Error when I execute some scripts.

I have narrowed it down to sections of the scripts that use the mysql_connect(). Other scripts, that don't reference the database, work.

It seems like when it tries to use the DB library it throws an error. How do I troubleshoot this error?

Fresh installation of XP Professional, PHP5 (current General Release) and MySQL5 (current generally available release) and Apache 1.3.41.
Question by:DrDamnit
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 32

Author Comment

ID: 21847285
Found a clue?
PHP Warning:  require_once(./includes/Defines.php): failed to open stream: No such file or directory in C:\Webroot\\wikimanual\index.php on line 30
PHP Fatal error:  require_once(): Failed opening required './includes/Defines.php' (include_path='.;c:\php\includes') in C:\Webroot\\wikimanual\index.php on line 30

Open in new window

LVL 82

Expert Comment

ID: 21847288
update mysql_connect(...) to:
mysql_connect(...) or die( "Error: ".mysql_error() );

LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 250 total points
ID: 21847312
>PHP Warning:  require_once(./includes/Defines.php): failed to open stream: No such file or directory in C:\Webroot\\wikimanual\index.php on line 30

check the index.php on line 30, it does a require_once as shown, however, the file:
does not exist.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 82

Expert Comment

ID: 21847321
Ok. That's the reason. Your script is unable to locate Defines.php. Basically the path to that is incorrect. Try providing the full path:

(I am just guessing the path. Adjust if necessary)
LVL 32

Author Comment

ID: 21848973
The problem was with PHP5. I restored C:\PHP5 from a backup, and now everything is gravy.
LVL 82

Assisted Solution

hielo earned 250 total points
ID: 21849566
>> and now everything is gravy
Yummy! Glad things worked out. Take care!

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question