Buyocat Posted May 10, 2006 Share Posted May 10, 2006 Hi I am having a problem getting my mac to display errors for PHP when I use it as a server. I set up web sharing and am able to load up PHP and HTML files without a hitch. I checked to make sure that I'm running the right version of PHP, v. 5, and this brings us to the problem. I have created a set of classes (Abstract -> normal) and I call the normal one in the index page (I use __autoload if it makes any difference) it looks like this:<?phperror_reporting(E_ALL);function __autoload ($class) { $path = eregi_replace ('_', DIRECTORY_SEPARATOR, $class); require ('./Class/'.$path.'.php');}$item = new Library_Book ('Catch-22', 'Joseph Heller', 'New York Press', 'Satire');$item->writeOut();?>as you might notice I tried setting the error reporting to all (which I believe I read would report all erros), still I do not get error messages, just a blank screen. This might suggest that there was some fatal error, but when I upload the same code to a web server running PHP 5 the code executes correctly. Does anyone know how I can get some indication of what's wrong? Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/ Share on other sites More sharing options...
wildteen88 Posted May 10, 2006 Share Posted May 10, 2006 Your server most likely has display_errors turned off therefore no errors are displayed. error_reporting changes the level at which PHP reports the errors it wont display the errors to the browser unless display_errors is set to on. However if there are any errors then they will be written to a log file, usually in the system log. Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/#findComment-35044 Share on other sites More sharing options...
Buyocat Posted May 10, 2006 Author Share Posted May 10, 2006 Thanks for the reply, I don't see any log file being written, so maybe I can try to change things so the PHP displays errors, this isn't ever going to be live so I don't think I need to worry about prying eyes. Is there any easy way to do that (change error display settings)? Once upon a time I tried to tweak the php.ini file following some instructions I found, but that didn't seem to have any effect. Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/#findComment-35045 Share on other sites More sharing options...
ober Posted May 10, 2006 Share Posted May 10, 2006 The error display settings are all found in php.ini, so if you're going to tweak something, that's where it would be at. Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/#findComment-35046 Share on other sites More sharing options...
wildteen88 Posted May 10, 2006 Share Posted May 10, 2006 To change the way PHP functions you need to edit the php.ini file. Any changes you make needs to be saved. Now the important part. You [b]must[/b] restart the Apache server or what ever server you are running for the new changes to take affect, otherwise any changes made to the php.ini file will not become available until the next reboot of the server. Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/#findComment-35048 Share on other sites More sharing options...
Buyocat Posted May 10, 2006 Author Share Posted May 10, 2006 Thanks, Wild, for you help. I managed to find and try:ini_set("display_errors","1");and it has worked. I was lead to believe, from php.net where I found this, that it won't handle fatal errors, but it seems that my computer-server is compaining about something non-fatal (although it was something that wasn't caught by my other server). I'll try to troubleshoot this, maybe I'll come back if I can't figure it out. Quote Link to comment https://forums.phpfreaks.com/topic/9485-mac-os-web-server-and-php-errors/#findComment-35059 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.