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 :

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

Upon checking the said filename ,
found out it is using trim() function 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.

$path = trim($path);

After that, the thumbnail was generated perfectly again.. 🙂

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

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.


Related Post

3 Responses

  1. robfish88 says:

    Thank you very much…….

  2. robfish88 says:

    Kindly advice, I want to use OpenWRT for my TP-Link router model TL-WR1043ND version 1.10 starting serial number with 12.

    Requested for UNIFI Malaysia 20 MB

    Kindly advice which files I do need to download, highly appropriated in advance .



    (Shah Alam)

  3. robfish88 says:

    Good Morning ,
    I have a TL-WR1043ND router Ver 1.10 and not able to find Hardware version, as what I understood from other posts that this should be then Hardware version 1.
    Have installed OpenWRT in total 3 files :
    German stock firmware (v3.9.17)
    – attitude_adjustment 12.09-rc2 and
    attitude_adjustment 12.09-rc2 and able to able access my router TL-WRT1043ND

    I guess that it is my age (59) but I a losing it on the configuration and explanation, first the first of all on many images that I have seen on the internet in the part Internet -> Swith VLAN witch is starting with PORT 1 -2-3-4-5-CPU however on my installed OpenWRT it starts with PORT 0-1-2-3-4-CPU so I guess something is already wrong on my side, having said this most images are related to HARDWARE VERSION 1.8

    My main goal is to get connect to UNIFI Malaysia (20MB connection) I know that Unifi provides an IPTV package but to honest I don’t need this IPTV connection at all.

    The bottom line, I like get connected to UNIFI with OPENWRT and I am really begging f someone can assist me in to get connect to Unifi. I know it is labor day (May 1) but will be great full if somebody can assist me.


Anything to add?