X
    Categories: Webdesign

Suppressing HTTPd warning message using PHP

I bumped into an error with the thumbnail generator for some Joomla library.
Each of the images generated would not having any image info inside but having error message instead.

So, upon checking , can’t trace from the log file.
I did tried to open up the file using the text edit , and found out it had the following content
instead of image data.

When can be read out as :


Warning : trim() expects parameter 1 to be string , resource given in /path/to/filename.php on line

Upon checking the said filename ,
found out it is using trim() for php.

and these is just a warning message , not an error.

one of the quick solution is suppress the warning message by adding the following line before that line.

error_reporting(0);
$path = trim($path);

After that, the thumbnail was generated perfectly again.. :)

or maybe can also use something similar as below ( ** UNTESTED ** ):



Namran Hussin: a soft spoken guy... with exceptional interest in computers and technology. I love to learn new thing and also love to break thing for the sake of learning.. but I do abide to the self-imposed limitation or certain thing such as social thing in life, thing can be done and thing that must be avoided at whatever cost such as drug,illegal tracking, smoke,illicit activity..etc.muahahaha let's share what we had in this short term of the life.! make it worth of the living.~
Related Post
Leave a Comment