0

Someone has asked me why there php file which is working as a javascript file is not working.

Ive tested on about 20 different servers including local computer and I cant replicate his error.

His error is:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.3 (CentOS) Server at domain.com Port 80

Ive got one of my servers on debug mode and no errors are coming from it what so ever.

Does his server need something activating, or installing to make this work?

Even when I remove any code within the file it still gives a 500 error.

So does this mean his site can not run with a php extension within the script like so:

<script type='text/javascript' src='http://domain.com/services/wp-content/themes/themename/js/sharrre.js.php?ver=1.0'></script>

The code within the file is:

header('Content-Type: text/javascript');

$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require( $parse_uri[0] . 'wp-load.php' );

$urlpath = get_stylesheet_directory_uri() . '/js/sharrre.php';
Robert
  • 907
  • 4
  • 13
  • 32
  • 1
    Has your friend looked in the server error log? – andrewsi Jun 27 '13 at 14:11
  • @andrewsi - no he has no idea how to do anything, and he wont give access, so I just wanted advice on if it could be the server and not the code, and if it is the server not having what is needed, I can advise him about it – Robert Jun 27 '13 at 14:16
  • I'd say that if identical code works on your machine, and doesn't work on his, then there's a configuration issue on his. The error log will tell him exactly what the problem is, but we can really only guess - there's some useful information here http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php about setting PHP up to display errors – andrewsi Jun 27 '13 at 14:20
  • @andrewsi - Ive set the error reports to show and and set the wordpress to debug and no errors are showing. – Robert Jun 27 '13 at 14:26
  • Sorry. I meant that he's going to have to do it, so he can see what's failing. – andrewsi Jun 27 '13 at 14:27
  • @andrewsi ill let him know :) Thank you – Robert Jun 27 '13 at 14:38

0 Answers0