mcerveni Posted April 23, 2008 Share Posted April 23, 2008 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... Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 are you looking at it ( the configuration with the blank page) with firefox? if so, check the page source of the blank page and tell me if the php code is there. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 also, what order did you install php, apache, and mysql, and what versions are they. Were they binary installers or did you compile the source code? Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 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? Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 oh ok thanks! yeah i'm running php javascript, mysql, html, css, even some ajax. i'm using windows xp pro. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 ok, also, what particular extensions do you need so I have the same setup as you when I'm working through it at home? Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 23, 2008 Share Posted April 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 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? Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 23, 2008 Share Posted April 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 is there a index.html or .php file in all of those sub-directories? Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 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. Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 23, 2008 Author Share Posted April 23, 2008 only .php files. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 23, 2008 Share Posted April 23, 2008 maybe the ajax is causing the server error? if that's the case I'm not very experienced in ajax at all. Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 24, 2008 Author Share Posted April 24, 2008 really? i don't think it's my code at all because it works on my laptop. and i have all the same configuration on my laptop. hm..i'll try the windows environment variables..because i haven't changed that yet..u know what im talking about? Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 24, 2008 Author Share Posted April 24, 2008 it wouldnt be ajax because localhost/khra directory has no ajax in it. just php and some javascript, but that's it. Quote Link to comment Share on other sites More sharing options...
lupld Posted April 24, 2008 Share Posted April 24, 2008 still looking for a fix? only thing I can think of is a clean install. Which MySQL are you using? Community edition? I can walk you through a configuration I tried last night that worked. Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 24, 2008 Author Share Posted April 24, 2008 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 »</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 » </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?? Quote Link to comment Share on other sites More sharing options...
lupld Posted April 24, 2008 Share Posted April 24, 2008 Try changing the <? } ?> at the end to <?php } end; ?> *edit I can't quite remember, it might be $end; instead... Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 24, 2008 Author Share Posted April 24, 2008 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? Quote Link to comment Share on other sites More sharing options...
lupld Posted April 24, 2008 Share Posted April 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.