Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

php Error Reporting

I am in the process of moving a large & complex site from another hosting company to GoDaddy. Yesterday, I was able to get it basically working; there was an issue with php generated emails, but for the most part, it worked.

Today, it behaves quite differently. Now, it is reporting php Warning errors, which I DO NOT want.

See attached jpg for example.

The GoDaddy people are clueless about this, so it occurred to me to change the php error reporting level. There was already a php.ini file there, I added the error_reporting parameter (see attached).

I Still get the same thing.

How can I suppress the php WARNING errors but keep the others?

Thanks
LSS-Menu.jpg
php.ini
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

To Kimputer

The example I showed dealt with the php date() function; there are HUNDREDS of other Warning error messages.

I want to TURN OFF all warning messages.
Avatar of Kimputer
Kimputer

php.ini:


display_errors = off
The GoDaddy people are clueless...
And that is exactly why I do not recommend GoDaddy hosting.  The only time you need an interaction with a smart person at a hosting company is when things go wrong.  As you have seen, you cannot get this interaction at GoDaddy.

You never want to suppress the error messages.  Instead the right thing is to find out what is causing them and correct the underlying causes.  In this case, you've got a good answer to the date/timezone issue.

In a deployed application, a reasonable setting might include error_reporting(E_ALL) combined with ini_set('display_errors', FALSE) and ini_set('log_errors', TRUE). This would give you a record of the errors without showing them to the client browser.  If the error_log file appears in any of your directories, you can look at it and find out what went wrong.
Ray,

I applied your recommended settings to the php.ini file.

See attached.

I uploaded the file to the root folder of my account.

It still does the same thing.

What did I do wrong?
php.ini
It isn't just Godaddy, most 'tech support' people are 'clueless'... because they are told not to help you with programming because it takes Way too much time.  

Last time I checked, on Godaddy you needed to name your added 'php.ini' as 'php5.ini'.  And even that Only works on Linux hosting on Godaddy.  If you try to add a 'php.ini' file on Windows hosting, you have to add the Entire file... which of course is not available.

Also, I know that Godaddy is only up to PHP 5.3.  If you try to move the site to 'better hosting' with PHP 5.4 or 5.5, you will see some of those warnings become errors.  Always better to fix the errors and warnings before they become more difficult later.
To Dave Baldwin,

I saved the ini file as php5.ini & uploaded it.

Nothing changed, same Warning errors.

There must be something wrong with the error reporting lines in the ini file.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It says error_reporting no value.

The current host is 1 & 1; the attached is a piece of the phpinfo there.

Note is says error_reporting 30719. What does that mean? Can I just say (in php.ini "error_reporting = 30719"?

I didn't look far enough, but, so far, the only other errors SEEM to be related to the timezone nonsense. For example:

Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone.
settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no DST' instead in /home/rkorts1/public_html/schedappt2.php on line 88
I forgot to attach.
error-rpt-1and1.jpg
To all,

I changed the php.ini file to the attached; note the inclusion of the recommended date.timezone parameter, I saved this BOTH as php.ini and php5.ini.

The same problem still persists.

Is there something wrong with the php.ini?

Do I have to do something differently?

Thanks
php.ini
Yes, you really need to move away from 1and1 hosting.  I just went to check a file on the only client account I have there... and instead of '404 Not Found', it put up an advertisement for Other Web sites.  Frankly 1and1 makes Godaddy look very good.
Yes, that's why I picked them, contrary to what some people say, before this fiasco, I have found their customer support to be EXCELLENT.

But I really need to solve the php.ini problem now.

Thanks
I don't think it's a 'php.ini' problem.  As I said, I don't believe you can get rid of the 'date' warning without simply fixing the problem.  And you have not posted any other warnings or errors that you are getting.  And by the way, when I checked the 1and1 account, they were still running PHP 4.4.9 which is Way out of date.  If the account you are transferring from was a PHP 4.4.9 account, you may have more surprises to come.
1and1 makes Godaddy look very good
+1 for that.  Truth.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please note that not all web hosters allow you to use your own php.ini file
Maybe the other user of GoDaddy just got lucky, and you landed on a server farm which doesn't allow it.
Try to set it during runtime (inside the php files):

error_reporting(0);
FYI, I will try to get GoDaddy to tell me WHY I can't use php.ini (or why it doesn't seem to take effect).
To all:

It turns out that at GoDaddy, the php.ini file has to be called .user.ini (with the leading . like .htaccess

That MAY be just for my plan (Ultimate with Cpanel) because the rep first told me that it had to be php5.ini.

Also, the item date.timezone = "US/Arizona"; does NOT work, maybe the syntax has to be different?

Just FYI.
Here is the list of supported Time Zones: http://us1.php.net/manual/en/timezones.php  America/Phoenix is probably the only one that works for Arizona since it does not support Daylight Savings Time.
Thanks, Dave.

In the individual php programs, I am using date_default_timezone_set('US/Central');

This works; no errors. I am just going to put this in an include & include it in ALL programs.

Not sure where the "Arizona" came from.
"US/Central" is listed Only for backwards compatibility.  http://us1.php.net/manual/en/timezones.others.php

You could use "America/Chicago" .  http://us1.php.net/manual/en/timezones.america.php

The 'standard' time zones that you may be thinking of do not correspond to the 'legal' time zones that have been implemented.  Arizona, for example, really does have it's own time zone for Date and Time purposes that is different than it's neighboring states.
Thanks Dave; that may be why it does not work.

But I'm preparing to bail ship at GoDaddy; their support in this case ranges from clueless to trying to be helpful but still not able to resolve issues.

Richard
You will not get much help from any hosting company for coding issues.  That's you ask questions here.