Chrisj Posted May 29, 2013 Share Posted May 29, 2013 I replaced a working file, with the same file from another working web site, but the new file generates a HTTP 500 internal server error page. The only difference in the new page are these lines: /////////////////////////////////////////////////// $_SESSION['searched'] = $_GET['keyword']; $prch = $_GET['p']; if ($user_id == "") { $new_temp = "themes/$user_theme/search_results1.htm"; }elseif ($prch == "1") { $new_temp = "themes/$user_theme/search_results2.htm"; }else{ $new_temp = "themes/$user_theme/search_results.htm"; } I'm hoping to learn the reason why these lines might be creating this error. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/278575-replaced-php-and-get-http-500-internel-server-error/ Share on other sites More sharing options...
Jessica Posted May 29, 2013 Share Posted May 29, 2013 Check your error log. Quote Link to comment https://forums.phpfreaks.com/topic/278575-replaced-php-and-get-http-500-internel-server-error/#findComment-1433088 Share on other sites More sharing options...
Chrisj Posted May 30, 2013 Author Share Posted May 30, 2013 I see no changes in the error_log file, nothing from today Quote Link to comment https://forums.phpfreaks.com/topic/278575-replaced-php-and-get-http-500-internel-server-error/#findComment-1433195 Share on other sites More sharing options...
dannon Posted May 30, 2013 Share Posted May 30, 2013 Have you modified anything in your .htaccess file? Could it be that your PHP script takes too long to run? Quote Link to comment https://forums.phpfreaks.com/topic/278575-replaced-php-and-get-http-500-internel-server-error/#findComment-1433200 Share on other sites More sharing options...
mac_gyver Posted May 30, 2013 Share Posted May 30, 2013 the most common reasons for a http 500 error from a .php script is a fatal parse error or a fatal runtime error and php's error_reporting/display_errors are not turned on. just the snippet of code you posted does not produce a fatal php error, though you may have introduced such an error depending on where and how you inserted those lines into the file and something that is dependent on the result from those lines might produce a fatal runtime error if data values are missing/wrong variables... you need to set php's error_reporting to E_ALL and either set display_errors to ON or set log_errors to ON in your php.ini (for a fatal parse error you cannot set them in your code because your code never runs) to find out what if any php detected errors there are. Quote Link to comment https://forums.phpfreaks.com/topic/278575-replaced-php-and-get-http-500-internel-server-error/#findComment-1433201 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.