Posted by greg.harvey on January 12, 2008 at 9:29pm
Jump to:
| Project: | Logo Tool |
| Version: | 5.x-2.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi,
I have been using LogoTool locally on my laptop without issue - today I uploaded my site to an eApps virtual hosting account and for some reason LogoTool doesn't work there. I have copied up my code exactly as is, taken a mysqldump and restored it on the remote machine, so in theory the two sites are identical.
However, all I get on the remote server is Error Creating Logo image:
http://www.classiccarsource.eu/
If I add print_r($logos) to the logotool_init() function in the module, the output appears to be correct:
Array
(
[files/logos/Alfa_Guilietta.gif] => stdClass Object
(
[filename] => files/logos/Alfa_Guilietta.gif
[basename] => Alfa_Guilietta.gif
)
[files/logos/Alfa_Montreal.gif] => stdClass Object
(
[filename] => files/logos/Alfa_Montreal.gif
[basename] => Alfa_Montreal.gif
)
[files/logos/Austin_Healey_3000_mk3.gif] => stdClass Object
(
[filename] => files/logos/Austin_Healey_3000_mk3.gif
[basename] => Austin_Healey_3000_mk3.gif
)
[files/logos/citroends.gif] => stdClass Object
(
[filename] => files/logos/citroends.gif
[basename] => citroends.gif
)
[files/logos/Ferrari_250_GTO.gif] => stdClass Object
(
[filename] => files/logos/Ferrari_250_GTO.gif
[basename] => Ferrari_250_GTO.gif
)
[files/logos/Fiat_500.gif] => stdClass Object
(
[filename] => files/logos/Fiat_500.gif
[basename] => Fiat_500.gif
)
[files/logos/jag01.gif] => stdClass Object
(
[filename] => files/logos/jag01.gif
[basename] => jag01.gif
)
[files/logos/Jaguar_S-Type.gif] => stdClass Object
(
[filename] => files/logos/Jaguar_S-Type.gif
[basename] => Jaguar_S-Type.gif
)
[files/logos/Lotus_Europa.gif] => stdClass Object
(
[filename] => files/logos/Lotus_Europa.gif
[basename] => Lotus_Europa.gif
)
[files/logos/Mercedes_280SL.gif] => stdClass Object
(
[filename] => files/logos/Mercedes_280SL.gif
[basename] => Mercedes_280SL.gif
)
)Very, very strange. Can you think of any known issues or PHP configs which might be causing this? I can't work it out. Especially since it all works great locally!
Thanks!
Comments
#1
Got it!
Warning: readfile() has been disabled for security reasons!!!! ;-)
#2
Nuts! That would have been my first suggestion and would have made me look very clever!!! ;o) Anyways, just to say that you don't have to use readfile to display the image, if all your logos are gifs you can simply use
imagegif- http://theserverpages.com/php//manual/en/function.imagegif.php - in the same manner the error logo is produced....but then I have noticed your site is working so I guess you've fixed it already then!
Thanks,
Pobster
#3
Yup, all sorted in the end. I have access to my php.ini file, so just enabled readfile(). (I love eApps for that - you get a proper VM...)
Thanks for the response! =)
#4
Hi,
I'm opening this again, because it's happening again. This time all I did was move the site to a new directory. I have chmod'ed all the sub-directories of files to 777 in case it was permissions... nothing. I checked the logs and they say this:
PHP Notice: Undefined index: logo in /home/webadmin/classiccarsource.eu/html/classiccars/logo.php line: 26Again, $logos looks fine in the modules. Very weird... =(
#5
I'm afraid I'm not going to get too involved in this as you're not having an issue with the module - you're having an issue with your server set up... Don't take this the wrong way though, I simply can't get involved in a conversation at the moment as I'm starting work at 1am tomorrow morning, which is approximately only 1 hour and 30 minutes away... I can't imagine for a second that I'm going to feel like helping anyone after working for 20 straight hours tomorrow...
...But anyways, here's what I think...
This appears to be what's being produced;
<br /><b>Notice</b>: Undefined index: logo in <b>/home/webadmin/classiccarsource.eu/html/classiccars/logo.php</b> on line <b>26</b><br />
NULL
<br />
<b>Notice</b>: Undefined index: logo in <b>/home/webadmin/classiccarsource.eu/html/classiccars/logo.php</b> on line <b>28</b><br />
GIF89aÈ�–�÷��
#6
Hi,
Thanks for replying again! Sounds like you could do with a holiday! ;-)
This is the first chance I've had to come back to this, but thanks for the observations. I initially thought that extra code was a patch someone has created for the module, but it seems not - that particular message is produced by the PEAR module:
http://pear.veggerby.dk/forum/comments.php?DiscussionID=638
So basically, what's happening is logo.php is prepending the PHP warnings before the actual binary of the image, which makes the PEAR module responsible for rendering the image baulk and give that message. So I just need to work out why logo.php has suddenly started producing these warnings:
<br /><b>Notice</b>: Undefined index: logo in <b>/home/webadmin/classiccarsource.eu/html/classiccars/logo.php</b> on line <b>26</b><br />
NULL
<br />
<b>Notice</b>: Undefined index: logo in <b>/home/webadmin/classiccarsource.eu/html/classiccars/logo.php</b> on line <b>28</b><br />
#7
Funnily enough I'm actually supposed to be on holiday right now (http://www.ciclosuno.com/node/705) but I didn't go as my work is just too busy! Still it was worth working 20 hours straight on Monday, managed to make quite a bit of money! ;o) Sometimes it's great being a futures trader!
Anyways... I've booked another holiday now for June now so it's all good... Anyways #2 - I'd recommend replacing the logo.php with a fresh copy, just in case you changed more than you realised?...
Pobster
#8
How annoying! Make hay while the sun shines, I guess. I'm in a similar situation, but I'm going on holiday anyway. Hope I don't end up regretting it!! ;-)
Anyway, I will try a fresh copy of logo.php right now - I outputted all the various variables on the production server and everything appears to be fine (except for that pesky warning):
<br />
<b>Notice</b>: Undefined index: logo in <b>/home/webadmin/classiccarsource.eu/html/classiccars/logo.php</b> on line <b>26</b><br />
/Austin_Healey_3000_mk3.gif
/home/webadmin/classiccarsource.eu/html/classiccars/files/logos/Austin_Healey_3000_mk3.gif
Array
(
[width] => 200
[height] => 150
[extension] => gif
[file_size] => 11955
[mime_type] => image/gif
)
Array
(
[0] => Content-Type: image/gif
)
Brb with report on the fresh script!
#9
Fresh download of the module, same issue. I wonder what's causing that warning??! Will keep investigating.
Just for the record, this application was sitting outside of version control. My problem started when I created a new SVN repository for it, committed the code, deleted the original and checked it out again *TO A DIFFERENT DIRECTORY* on the production server. I'm sure it's either a PHP setting or it's a permissions problem, but I just can't root it out. =(
It always worked fine locally, even now the same code is checked out in both environments, but since I used a checked out a fresh copy of the code on to production I've been getting these warnings. They weren't there before.
#10
Got it! After ignoring several articles saying "switch off notices" I found this infinitely more useful suggestion:
http://www.dmxzone.com/ShowDetail.asp?NewsId=13811
Off the back of that, I replaced:
$logo = $_GET['logo'] ? $_GET['logo'] : variable_get('logotool_logo', '');With:
if (!isset($_GET['logo'])) {$logo = variable_get('logotool_logo', '');
} else {
$logo = $_GET['logo'];
}
What do you think? Less elegant, but the notice was being caused by the empty $_GET array.
I can create a patch if you think it is a good idea.
#11
Ulp... Gosh... *cough* this is embarrassing... I'm afraid I've known about that since May last year; http://drupal.org/node/141366
I've not made a patch against the old version yet as I wanted to reprogram the module somewhat (do away with having a logo.php at all, I've thought of a way round the double bootstrapping issue) and well... Maybe I should add it asap - I could have saved you some trouble! Sorry!
Pobster
#12
Ah, the patch you linked to is nicer than mine! =)
No problem. Thanks for taking the time to write the module! I can hardly complain about a little PHP notice now, can I?!
#13
Closing off old issues.
Pobster