16, October 2008

Debug Help - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Debug Help
« previous next »
Pages: [1] Print

Author Topic: Debug Help  (Read 1392 times)
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« on: Nov 29, 2006, 02:59:42 PM »

Hi,

Firstly can I say phpUpload is a brilliant piece of code that I have used many times.

However recently I have had need to use it on a new server and now have the issue that when I upload an image I get the "successfully uploaded!" message but there is no file uploaded.

I checked the server and found that there ImageMagick wasn't installed so I have installed the following...
ImageMagick-6.2.3-0.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.0.6.tar.gz
ibtiff-lzw-compression-kit-1.1.targz
tiff-v3.5.5.tar.gz

However I still have the problem of no files being uploaded.

I have tried the upload_example.php and this works fine.
I have changed the flag to use the GD lib but thisdoesn't work because the php has been configured without GD!

So I am currently stuck,and would appreciate any sugggestions as what to try next?

Here is a link to the phpinfo...
http://www.aurafashion.co.uk/phpinfo.php Visit through proxy

Hope someone can help.

Thanks
Luke
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6357
38966 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Nov 29, 2006, 03:32:04 PM »

Hi Luke, I'm sorry to say but my only advice is to move to a real web server IM is not special and is free. There is no reason for a hosting company to offer a web host without any image processing tool. I know shared hosting for only 12 $ a year offering a complete web server...


Last blog : Upload images for usage in TinyMCE
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #2 on: Nov 29, 2006, 03:44:09 PM »

Hi Olaf,

I have installed IM on the server and I can run the Image Magick commands from the command line.
I have root access to the server, so can change anything that needs to be changed.

Unfortunatly changing server isn't an option.  Sad

Do you have any suggestions of where I can put break points to see how far the code is executing before it fails?

Cheers
Luke
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6357
38966 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Nov 29, 2006, 03:49:59 PM »

Quote
I have installed IM on the server and I can run the Image Magick commands from the command line.

than it should be possible to run the script as it is...

which command do you tried via the command line?

and maybe it's the exec() function that not allowed...


Last blog : Upload images for usage in TinyMCE
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #4 on: Nov 29, 2006, 04:09:49 PM »

Bingo! Its the exec function that is not being allowed...

Happy to know why its not running, but what can I do about this?

is it a case of recompiling the php?

I have run mogrify and convert from the command line so I know that IM works.

Arrghh so close now... hope there is an easy solution.

Cheers
Luke
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8132
41749 credits
Members referred : 3



« Reply #5 on: Nov 29, 2006, 04:12:54 PM »

Quote
is it a case of recompiling the php?

No you need to change php.ini

This can be because of safe_mode = on or exec is disabled

In anyway you have to edit your php.ini file Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #6 on: Nov 29, 2006, 04:27:05 PM »

Hmmm, having examined the php.ini I cannot see where this would be disabled or blocked

Safemode is off in the php.ini

A copy of the php ini can be found here...
http://www.onixsystech.co.uk/php.txt Visit through proxy

Looks ok to me or am I missing something?

BTW
 this is the code in the php...

Code:
exec(sprintf("/home/default/image/ImageMagick-6.2.3/utilities/convert %s -resize %dx%d -quality %d %s", $file_name_src, $w, $h, $quality, $file_name_dest));

Cheers
Luke
« Last Edit: Nov 29, 2006, 04:34:50 PM by Luke_T »
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8132
41749 credits
Members referred : 3



« Reply #7 on: Nov 29, 2006, 04:38:40 PM »

Then maybe the php process (or the apache process) don't have permission to execute the IM?

What is the error that you get now?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #8 on: Nov 29, 2006, 04:47:16 PM »

THats the problem, I don;t get any errors... unless they are logged somewhere?

All I know is that when it comes to the exec command running with mogrify and convert nothing happens.

Could this be because IM has installed incorrectly? Or that apache doesn't have permission to run it?

I notice that on the new server when search for convert files I get the following results...

Code:
[root@localhost /]# find -name convert
./home/default/image/tiff-v3.5.5/contrib/acorn/convert
./home/default/image/ImageMagick-6.2.3/utilities/.libs/convert
./home/default/image/ImageMagick-6.2.3/utilities/convert

However on the server where easyphpupload works I get the following results...

Code:
root@pmhltaa4 [/]# find -name convert
./usr/bin/convert

I'm not sure if this is relevant?


I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8132
41749 credits
Members referred : 3



« Reply #9 on: Nov 29, 2006, 04:50:35 PM »

Quote
Could this be because IM has installed incorrectly? Or that apache doesn't have permission to run it?

Both can be the case.

the find command looks ok. Try this after you run the script:

Code:
# tail /tmp/php.err

(or php5.err)

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #10 on: Nov 29, 2006, 05:06:46 PM »

I don't seem to have either php.err, php5.err or any .err file

Anywhere else I should be looking?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6357
38966 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Nov 29, 2006, 05:08:13 PM »

hey guys what is this about Cheesy

maybe its time to move the thread to the linux forum hehe...


Last blog : Upload images for usage in TinyMCE
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #12 on: Nov 29, 2006, 05:10:52 PM »

Hahaha, yeah maybe!!


I looked in the /var/log/httpd/error_log and found the following...
Code:
/usr/bin/ld: cannot open output file /home/default/image/ImageMagick-6.2.3/utilities/.libs/1404-lt-convert: Permission denied
collect2: ld returned 1 exit status


Looks like the problem, but not sure what to do about it?

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6357
38966 credits
Members referred : 374


It's time to use PHP5!


« Reply #13 on: Nov 29, 2006, 05:13:01 PM »

I'm not sure about linux but it looks to me that the user apache has no root access rights...


Last blog : Upload images for usage in TinyMCE
Atari ST fan
*
Posts: 8
52 credits
Members referred : 0


« Reply #14 on: Nov 29, 2006, 05:40:43 PM »

You guys are the BOMB!!!

I changed ownership to apache and .... IT WORKS!!!

God damn I am one happy dude!

Thank you so much for your help!
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6357
38966 credits
Members referred : 374


It's time to use PHP5!


« Reply #15 on: Nov 29, 2006, 06:01:30 PM »

You guys are the BOMB!!!

I changed ownership to apache and .... IT WORKS!!!

God damn I am one happy dude!

Thank you so much for your help!


hehe that was the first time I helped someone with a linux problem...(maybe I should start my ubuntu machine for 5 minutes) lol


Last blog : Upload images for usage in TinyMCE
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8132
41749 credits
Members referred : 3



« Reply #16 on: Nov 30, 2006, 09:10:41 AM »

Wait a second. What you mean you changed Apache rights?

Have you changed the owner of the apache? If this is the case then you may have added a hole to your system.

The correct thing to do is :

Code:
chown nobody:nogroup convert

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4979
Tags : php forums apache linux php.ini Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Debug Help
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct 16, 2008, 06:16:40 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!





Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.