Jump to content

PHP page blank, HTTP 500 Internal Server error


mcerveni

Recommended Posts

I reformatted my computer, installed apache 2.2, php 5.2, mysql 5.0 and phpMyAdmin as well... phpMyAdmin could not load mysql extensions until i put my php.ini file in the C:/PHP folder, instead of putting it in the Windows folder. so everything was working great, until i dumped all my websites onto my computer. When i go to for example: localhost/watchclockshop/index.php it'll say HTTP 500 Internal Server error, if i go to localhost/watchclockshop/wcsas/ it will be just a blank screen...

if i take out php.ini out of the Windows folder and leave it in my C:/PHP , then localhost/watchclockshop WILL SHOW UP. however, it still will be a blank screen when i go into localhost/watchclockshop/

 

what the hell is going on? lol .

 

any help appreciated...

Link to comment
Share on other sites

if i view the page source for example localhost/khra, it shows the following:

 

<html>

 

 

 

<script type="text/javascript">

function closeErrMsg()

{

 setTimeout ( "close()", 2500 );

}

 

function close()

{

 document.getElementById("errMsg").style.display="none";

}

 

function closeEmailSent()

{

 setTimeout ( "close2()", 3000 );

}

 

function close2()

{

 document.getElementById("confirmSent").style.display="none";

}

 

 

function closeEmailError()

{

 setTimeout ( "close3()", 3000 );

}

 

function close3()

{

 document.getElementById("emailError").style.display="none";

}

 

 

 

</script>

 

 

 

if i go to localhost/khra/khraas    it displays the page perfectly.

if i go to localhost/watchclockshop  it displays the following:

 

<html>

 

 

 

if i go to localhost/watchclockshop/wcsas/ page source displays:

 

<html>

 

 

 

<META HTTP-EQUIV=Refresh CONTENT="1500; URL=index.php?i=true">

 

 

 

 

<!--SESSION TIMED OUT DIV-->

<div class="confirmDelete" align="center" style="margin-left:430px; margin-top:70px; position:absolute; z-index:2; display:none" id="idleBox">

<b class="xtop1confirmDelete"><b class="xb11confirmDelete"></b><b class="xb21confirmDelete">

</b><b class="xb31confirmDelete"></b><b class="xb41confirmDelete"></b></b>

<div class="confirmBox">

 

<div class="confirm_header"> Warning </div>

 

<p>

<table>

<tr>

<td style="color:black" nowrap >

Your session has expired. Please login again.  

</td>

</tr>

 

<tr> <td align="center">

<input style="border:none" type="image" src="images/buttons/ok.gif" border="0"

onclick="document.getElementById('idleBox').style.display='none';

document.getElementById('dimScreen').style.display='none'; ">

</td></tr>

</table>

</p>

 

 

 

</div>

<b class="xbottom1confirmDelete"><b class="xb41confirmDelete"></b><b class="xb31confirmDelete"></b>

<b class="xb21confirmDelete"></b><b class="xb11confirmDelete"></b></b>

</div>

 

 

</div>

 

 

 

 

my error log in apache says:

 

Wed Apr 23 13:31:53 2008] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  username in C:\\watchclockshop\\wcsas\\include\\functions.inc.php on line 310

[Wed Apr 23 13:31:53 2008] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in C:\\watchclockshop\\wcsas\\include\\menu.inc.php on line 42

[Wed Apr 23 13:31:55 2008] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in C:\\watchclockshop\\include\\menu.inc.php on line 37

[Wed Apr 23 13:32:14 2008] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in C:\\watchclockshop\\include\\menu.inc.php on line 37

[Wed Apr 23 13:32:21 2008] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in C:\\khra\\include\\menu.inc.php on line 35

[Wed Apr 23 13:32:29 2008] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in C:\\khra\\include\\menu.inc.php on line 35

[Wed Apr 23 13:32:54 2008] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  username in C:\\khra\\khraas\\include\\functions.inc.php on line 1229

[Wed Apr 23 13:32:54 2008] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  i in C:\\khra\\khraas\\index.php on line 4

[Wed Apr 23 13:32:54 2008] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  admin_logged_in in C:\\khra\\khraas\\index.php on line 20

[Wed Apr 23 13:32:54 2008] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  user in C:\\khra\\khraas\\include\\functions.inc.php on line 151

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/khra/style/loginError_inFolder.css, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/khra/scripts, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/khra/style/login2.css, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/khra/wysiwyg.js, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/Apache/Apache2/htdocs/lightbox, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/Apache/Apache2/htdocs/lightbox, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/Apache/Apache2/htdocs/lightbox, referer: http://localhost/khra/khraas/

[Wed Apr 23 13:32:55 2008] [error] [client 127.0.0.1] File does not exist: C:/Apache/Apache2/htdocs/lightbox, referer: http://localhost/khra/khraas/

 

 

thanks for your quick reply by the way, :) i have a meeting tomorrow afternoon, an online meeting to show a client of mine his website lol and nothing is working, hopefully you can help.

Link to comment
Share on other sites

i installed apache 2.2.8 first, then php 5.2.5 (used installer first, then binary to get the extra extensions), then mysql 5.0, then phpMyAdmin.

i uninstalled apache 2.2.8 and put 2.0 to see if it made a difference..still the same issue.

 

the wierd thing is, my individual files will show up properly..for example: mail.php that's in my htdocs, will work fine, just not my web projects that are in folders like htdocs/watchclockshop or htdcos/khra.

 

 

Link to comment
Share on other sites

I don't have my computer here so I can't play around with apache, but when I get home in about an hour and a half I'll work on it if nobody else has an answer. You're trying to run php, html, mysql and javascript, right? And by the way, which operating system are you using?

Link to comment
Share on other sites

extensions? you mean in C:/PHP/ext/

 

in my php.ini file i have

; Directory in which the loadable extensions (modules) reside.

extension_dir = "C:/PHP/ext"

 

and:

 

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_mbstring.dll

 

my php.ini file is in C:/PHP 

if it was in C:/Windows only, then my phpMyAdmin can't load the mysqli extensions.

 

 

 

Link to comment
Share on other sites

my php.ini file is in C:/PHP 

if it was in C:/Windows only, then my phpMyAdmin can't load the mysqli extensions.

It is not necessary to move files outside of the PHP installation folder. Always keep files within the PHP Installation folder, if you moves files about it can cause more problems especially when upgrading PHP.

 

I always suggest adding PHP to the PATH Environment Variable. In order for php_mysql.dll or php_mysqli.dll to function they require an external library call libmysql.dll (which is in the PHP installation folder C:/php)

 

Aslso I recommend you to enabled display_errors and set error_reporting to E_ALL within the php.ini. That way PHP will display errors to the browsers rather than displaying a blank screen.

 

Make sure you are restarting Apache after making changes to the php.ini

Link to comment
Share on other sites

easiest way is to just use the windows binary (the installer) for php, is installs all the files you need and makes the necessary changes to your config file for you. (there might be a line or two left out, as I remember). but this reminds me, the files that are in htdocs, that are working... are they .html files? or is it any file in htdocs works, and any sub folders don't?

 

In other words, is it htdocs work, but subfolders do not - or is it .html files work and .php files do not?

Link to comment
Share on other sites

the files in htdocs are not html files im working with..they are php files. individual php files work in htdocs.

but, a folder inside htdocs that have php files in it, they do not work.

 

also,

since i took php.ini file out of c:\Windows/  the sub folder inside the folder in htdocs (C:\apache/htdocs/khra/khraas ) works...

but C:\apache/htdocs/khra/ doe snot work, just blank screen. 

 

another folder in htdocs called watchclockshop does not work either. just http 500 internal error it displays.

Link to comment
Share on other sites

To test is your server is properly configured. Create a new file called phptest.php with the following code in the htdocs folder:

<?php phpinfo(); ?>

And run http://localhost/phptest.php if outputs PHP current configuration then Apaches configuration is ok. Now to see if subfolders work create a subfolder in the htdocs folder and call this new folder subfoldertest and move phptest.php to it. Now run http://localhost/subfoldertest/phptest.php if you get the same output then Apaches configuration is fine.

 

In which case from the problems you are having it sounds like its to do with how your site is coded. However please read my post here regarding the php.ini

 

 

Link to comment
Share on other sites

It's not the way my site is coded, because the same configuration was on my laptop, i haven't changed the way i configure apache php mysql and phpmyadmin...

 

i have my php.ini file in C:\Windows, if i took that out of the windows folder and put it in C:\PHP , then the localhost/khra/khraas works.

so the sub folder works, if i go to localhost/khra it does not work, just a blank screen.

 

if i go to localhost/watchclockshop it says http 500 internal server error, and the subfolder to that is just a blank screen.

 

you see? same situation, but two different errors occur.

 

if i have the php.ini file in C:/PHP and in C:/Windows, then i still get an http 500 internal server error when i go to localhost/watchclock shop AND  a blank screen at localhost/khra/khraas which is the subfolder .

 

i already have a test.php with phpinfo() in it and it works in htdocs.

 

so to sum it up, it's not my php that's the problem, it must be some kind of server error.

 

i should mention i dont have my windows enviroment variables set up though..

 

also, when i put display_erros on in my php.ini , i still recieved the same http 500 internal server error and blank screen in both situations... no php errors showed up.

 

 

Link to comment
Share on other sites

I'm trying to think, but I've never really had a problem with a 500 error.

 

*edit*

also, the only thing I can really think of is reinstalling apache in another location, installing php from the an installer and selecting the mysql extensions, and then testing that.

 

I think installing that way requires two extra lines of code to get it to work, I'll try it out real quick.

Link to comment
Share on other sites

ok, so i turned on display_errors in my php.ini and it gives me this:

Parse error: syntax error, unexpected $end in C:\Apache\htdocs\watchclockshop\include\menu.inc.php on line 38

 

my menu script is :

 

<?php function populateMenu() { ?>

<div align="left" class="navLinks" id="chromemenu">

<ul>
<li> <a href="index.php" style="margin-left:8px"> Home </a> </li>
<li> <a href="#" rel="products"> Category &#187;</a> </li>
<li> <a href="#" > Services </a>  </li>
<li> <a href="#" > About </a>  </li>
<li> <a href="#" onclick="document.getElementById('open_contact_form').style.display='block';" > Contact </a>  </li>
<li> <a href="#"  > Links &#187; </a>  </li>

</ul>


</div>

<div id="products" class="dropmenudiv">
<a href="#"  > Watches</a>
<a href="http://www.cssdrive.com" onmouseover="this.style.fontColor='nothing'">Pocket Watches</a>
<a href="http://www.javascriptkit.com" onmouseover="this.style.fontColor='nothing'">Wall Clocks</a>
<a href="http://www.codingforums.com" onmouseover="this.style.fontColor='nothing'">Mantel Clocks</a>
<a href="http://www.javascriptkit.com/jsref/" onmouseover="this.style.fontColor='nothing'">Grandfather Clocks</a>
<a href="http://www.javascriptkit.com/jsref/" onmouseover="this.style.fontColor='nothing'">Grandmother Clocks</a>
<a href="http://www.javascriptkit.com/jsref/" onmouseover="this.style.fontColor='nothing'">Swiss Army Knives</a>
</div>


<script type="text/javascript">

cssdropdown.startchrome("chromemenu")

</script>


<? } ?>

 

i had php5.1 before, since i installed php5.2.5 it's giving me this parse error..what's wrong with it??

Link to comment
Share on other sites

lol well... that worked.

what changed from php 5.1 to 5.2?? because i'll have a problem then..

 

i am getting this now:

Notice: Use of undefined constant end - assumed 'end' in C:\Apache\htdocs\watchclockshop\include\menu.inc.php on line 37

 

is the notice showing up because i have display_errors on?

Link to comment
Share on other sites

try and change it to $end; and I'll look it up on php.net to make sure. I'm guessing that on 5.1 it assumed an end when it got to the end of the file, but in 5.2 they disabled this so people can't run a partially finished file that may contain security issues

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.