views:

31

answers:

2

I am trying to use NuSoap in PHP 5.3. When I debug my script in Eclipse I get a lot of Deprecated warnings but the script still runs, however when I call the script thru Apache on my localhost the script terminates without any explanation. I'm not really a web-head yet, and being somewhat of a noob at this, I am at a loss as to why it would work on the same machine while debugging, but not thru Apache. What are the possible causes that would make a script run in Eclipse, but not run when I call it from say the browser. Also, when the script fails outside of the debugger, does it spit out some kind of log or debugging data somewhere, and if so how could I locate that?

A: 

It's probably throwing a fatal error, but you have display_errors turned off on your production server (as you should), so it won't output errors in html, as your development version will. Check your php.ini for the location of the error log, or ask your server admin to point you in the right direction. You'll need to have file level access to the server, or a control panel which will display it for you.

Alternatively, you can turn display_errors on in a .htaccess file, local to that application only.

php_flag display_startup_errors on
php_flag display_errors on

Or if displaying errors is not an option, and you can't access your logfile, you could set your error log to a custom location, as long as it's writable by apache:

php_flag  log_errors on
php_value error_log  /absole/path/to/a/writable/directory/php_errors.log
Andru
A: 

PHP has several directives that define the behaviour of error reporting. The most important ones are:

The first one sets the severity of error reporting: you can tell PHP to warn on every possible issue, warn only on fatal errors, etc. The second one instructs PHP to display error messages on screen or not. This options are not hardcoded: they can be set on runtime.

See also log_errors.

As about how to change these options, you can always change them for the whole system if you have access to the main php.ini file. It's also possible to change them in a per-site basis, but the exact mechanism depends on how PHP interacts with the web server. If it runs as Apache module (a common setup), you can use an .htaccess file.

You'll find lots of info here: http://www.php.net/manual/en/configuration.php

Álvaro G. Vicario