Solved

PHP5 + MySQL gives Internal Server Error

Posted on 2008-06-23
6
339 Views
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.
0
Comment
Question by:DrDamnit
  • 3
  • 2
6 Comments
 
LVL 32

Author Comment

by:DrDamnit
ID: 21847285
Found a clue?
PHP Warning:  require_once(./includes/Defines.php): failed to open stream: No such file or directory in C:\Webroot\somedomain.com\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\somedomain.com\wikimanual\index.php on line 30

Open in new window

0
 
LVL 82

Expert Comment

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

0
 
LVL 142

Accepted Solution

by:
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\somedomain.com\wikimanual\index.php on line 30

check the index.php on line 30, it does a require_once as shown, however, the file:
C:\Webroot\somedomain.com\wikimanual\includes\Defines.php
does not exist.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 82

Expert Comment

by:hielo
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:
require_once('C:\Webroot\somedomain.com\wikimanual\includes\Defines.php');

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

Author Comment

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

Assisted Solution

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now