There are times when provider changes server and doesnt put everything back as it was before. Mostly this concerns PHP error reporting settings.
Of course, in old days nobody took a good care of proper coding so often $array[key] was used instead of $array['key'] and this is just one of the smallest things around.
I promise to write later a basic guide for avoiding common PHP error stuff like inproper use of quotes, also inside regular expressions (shame on you TCPDF, have you ever thought of checking your code with notices turned on?
Anyway, i also met people who just try to solve “notices” and “warnings” just by putting error_reporting(‘E_NONE’) but – come on. Its just curing symptoms, not the disease. I always prefer to code with everything turned on, even “notices”.
So, what did i want to say – even if something happens and you notice that the code you wrote long ago start to throw “notices” and “warnings” that doesnt break the code, but nicely break the layout, AND you dont have time (will, money) to refactor the code, and you still dont want to wander around all those millions of PHP scirpts you proudly used to call “CMS”… then just suppress all PHP errors in apache (if you dont use apache, then, so long…) level by putting this into .htaccess file of your web root:
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value error_reporting 1
I hope i dont have to explain “how” to put .htaccess file in your web root and that you just can’t create .htaccess file on windows Xp (dunno about W7 or vista, i am Mac guy).
The code abode will put one centralized rule on all php scripts. Unless you have written error_reporting (E_ALL ~ E_NOTICES) in every file. If so, good luck removing them.
By the way you can do reverse psychology – evaluate the code of your freelancer by turning errors on all at once:
php_flag display_startup_errors on 1
php_flag display_errors on
php_flag html_errors on
php_value error_reporting 30719
1 – this works on PHP 5.3.x for PHP 5.2.x use
6143 and for later – 2047
More about constants you can read on php.net about predefined constants. especially i would point attention to “depreciated” stuff since that might not work after next “server upgrade”.
Just as remindment – if you want to hide code in php script, then put this in the beginning of index.php or any other place where you want to localize message:
<?php
ini_set('display_errors', 0);
error_reporting('E_NONE');
?>
or vide versa – shorthand to turn on all errors:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
?>
Take care,
Edgars
P.S yeye, i know i’ve been quiet for past few months, but i am back soon and when i am back i tell about all kinds of fun stuff like PHPUnit, design patterns like factory and singleton, new fun stuff from HTML5, how to build nice gallery just by uploading files via ftp and what else… naming variables and other cool things i am getting in touch with every day.




I found your weblog web site on google and examine a couple of of your early posts. Proceed to maintain up the extremely excellent operate. I just extra up your RSS feed to my MSN News Reader. Searching for forward to reading extra from you afterward!? I am often to running a weblog and i genuinely appreciate your content material. The write-up has truly peaks my interest. I’m going to bookmark your internet site and preserve checking for brand new details.
Howdy! Would you mind if I share your blog with my facebook group? There’s a lot of people that I think would really appreciate your content. Please let me know. Many thanks
That’s what i call “great post”. Thank you so much.
Excellent post. I learned a lot reading it. Thanks.
That’s what i call “great post”. Thank you so much.
That’s what i call “great post”. Thank you so much.
There are a few interesting tips soon enough in this particular writing however I don’t understand if I see all of them core to heart. You will find several validity but I’ll take hold belief till I check out this further. Very nice article , thank you and we wish more! Added to FeedBurner as well
What are you stating, man? I recognize everyones got their own view, but really? Listen, your blog is interesting. I like the energy you put into it, specifically with the vids and the pics. But, come on. Theres gotta be a better way to say this, a way that doesnt make it seem like everybody here is stupid!
Valuable information. Lucky me I discovered your website by accident, and I am shocked why this accident did not happened earlier! I bookmarked it.
I truly like this blog internet site, will surely come back once again. Make certain you carry on creating quality content articles.
Excellent post, mate! Thanks for the useful information
Excellent post. I learned a lot reading it. Thanks.
Excellent post. I learned a lot reading it. Thanks.
Nice post. I was checking continuously this blog and I’m impressed! Very useful information specifically the last part
I care for such info much. I was looking for this particular information for a long time. Thank you and best of luck.
You can certainly see your skills within the paintings you write. The world hopes for even more passionate writers like you who are not afraid to say how they believe. All the time go after your heart. “No man should marry until he has studied anatomy and dissected at least one woman.” by Honore’ de Balzac.
Excellent post. I learned a lot reading it. Thanks.
Awesome material you fellas got these. I truly like the theme for the internet site along with how you organized a person who. It is a marvelous job For certain i will come back and have a look at you out sometime.
Excellent post, mate! Thanks for the useful information
Howdy Guru, what entice you to publish an article. This text was once extremely fascinating, especially in view that I was searching for thoughts on this topic last Thursday. https://www.lifereader.co.uk/psychics/free_psychic_chat
That’s what i call “great post”. Thank you so much.
I’m glad to be a visitant of this complete weblog ! , thankyou for this rare information ! .
That’s what i call “great post”. Thank you so much.
That’s a great post. Thank you so much.
This web site certainly has all the info I wanted concerning this subject and didn抰 know who to ask.
Excellent post, mate! Thanks for the useful information
Just a smiling visitant here to share the love (:, btw great pattern. “Make the most of your regrets… . To regret deeply is to live afresh.” by Henry David Thoreau.
I had an issue viewing this page in IE, but with Firefox I had no issues.
I think so. I believe your article will give those individuals a great reminding. And they will express thanks to you later
That’s a great post. Thank you so much.
That’s what i call “great post”. Thank you so much.