Problems with Upload of jpg and gifs.

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
jhannemann
Posts: 1
Joined: Mon 2. Jan 2006, 18:11

Problems with Upload of jpg and gifs.

Post by jhannemann »

Hi,
I don´t know why I have the problem. From one day to another day I´m getting the following report, when I make an upload od pics.

Warning: imagejpeg(): Unable to access /home/strato/www/sa/www.sail-marketing.de/htdocs/content/im ... e1c40c.jpg in /mnt/ja2/04/943/00000006/htdocs/include/inc_ext/ss_image/ss_image.class.php on line 202

Warning: imagejpeg(): Invalid filename '/home/strato/www/sa/www.sail-marketing.de/htdocs/content/im ... e1c40c.jpg' in /mnt/ja2/04/943/00000006/htdocs/include/inc_ext/ss_image/ss_image.class.php on line 202




I didn´t chance anythind in phpwcms configuration. The only thing I change was the programm I use for pic-work.

CAn somebody help in a easy way?

Thanks Jens
Ben
Posts: 558
Joined: Wed 14. Jan 2004, 08:05
Location: Atlanta
Contact:

Post by Ben »

At first glance, it looks like your web server path in config.inc.php may be incorrect. I looks like you entered - /home/strato/www/sa/www.sail-marketing.de/htdocs/.

I would try making it /mnt/ja2/04/943/00000006/htdocs/

Maybe I've got the two backward, but it seems like this might be the root of your issues.
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi,

nearly the same problem on a website of my friend. Strato is the hoster, too.

It seams that strato modified their server, 'case the current php version is compiled on November 1st. Everything works fine till now.

I've changed the document root but no solution.

We need help here too.

Cheers
KiWiX
Ben
Posts: 558
Joined: Wed 14. Jan 2004, 08:05
Location: Atlanta
Contact:

Post by Ben »

Here's something you can try - Re-upload your the setup folder and run through it to see what is the recommended server path. BE CAREFUL that you don't accidentally over write your existing database.
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi Ben,

I've checked this.

New created config file is the same. It will use the server var document root.

I'm a little bit confused. It seams that the image script will use another path to images, then the rest of phpwcms.

Tomorrow I will take a look at the scripts.

Cheers
KiWiX
Ben
Posts: 558
Joined: Wed 14. Jan 2004, 08:05
Location: Atlanta
Contact:

Post by Ben »

Also, you should inquire with your webhost to find out what the true server paths are. Tell them that everything used to work with no problems, etc. and show them the error messages, as it may be useful to them. Good luck with everything!
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi,

maybe another on has a hint.

I tried all lot of things, like changing the root path (instead of using the document_root from the $_server, added debug output to ss_image.class.php but I can't find the error.

Does anybody knows, where the ss_image class get's the $where definition (that means the path, where it should store the preview image).

The support from strato didn't answer till know :-(

Cheers
KiWiX
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post by rushclub »

give us a link and we will see.

rush
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

If it worked before... and you didn't change anything... how could the script be at fault... Hmmmmmm :shock:

Try the Environment variable route -OR- the "commented-out" explicit path declarations

Code: Select all

// site values
$phpwcms["site"]            = "http://".$_SERVER['SERVER_NAME']."/";
//$phpwcms["site"]              = "http://www.sail-marketing.de/";

// paths
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'];
//$phpwcms['DOC_ROOT']          = '/mnt/ja2/04/943/00000006/htdocs';
$phpwcms["root"]              = "";
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi folks,

thanks for your help, so far.

@rushclub: I can't put a link here, 'cause I get the error only in the file administration (at the moment).

@deXXus: I've changed that already and it didn't work.

I've checked the directory permissions, too. For me everything looks okay.
There must be somethig special with the webserver from STRATO.
I've the same installtion on my SuSE Box. If you check the phpinfo() every path goes to the same path like $_SERVER['DOCUMENT_ROOT'] but if i call ss_image I see the error, like posted.

Why will ss_image use another path then the rest of the scripts. I'm really confused. Does anybody has an idea?

Really urgent, we can't change the content of our site.

Cheers
KiWiX
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

SOLVED

Post by kiwix »

Hello everyone,

I solved it. After a long time of testing I found out that the problem is the php function imagejpeg from GD.

STRATO uses the newest PHP 4.4.1 on theri server, which they build on Nov. 11st 2005.

Now you can find a small notice in the changelog:

- Added missing safe_mode checks for image* functions and cURL.
see: http://de.php.net/manual/de/function.imagejpeg.php
and: http://www.php.net/ChangeLog-4.php#4.4.1

And there is the problem. To get phpwcms image functions to run on a php 4.4.1 environment you have to use the following workaround in the funtion output of the ss_image.class.php:

Code: Select all

				ini_set(safe_mode,Off);
				touch($where);
				imagejpeg($image, $where, $this->cfg_JPEG_QUALITY);
				ini_set(safe_mode,On);
(sample is for the JPEG output near line 202).

This you have to do for every output of the image* functions with a valid target ($where). Then phpwcms will work as expected.

Cheers
KiWiX
Ben
Posts: 558
Joined: Wed 14. Jan 2004, 08:05
Location: Atlanta
Contact:

Post by Ben »

Wow ... I'm really glad for you guys that you got it working! You had to dig pretty deep to find an issue like that.
kiwix
Posts: 65
Joined: Fri 25. Feb 2005, 09:40

Post by kiwix »

Hi ben,

Yes it was a bit tricky but when ist done, it was fun :-)
I like that more than playing some stupid games on my pc :-))))

Sometimes I think Linus was right :-)

Cheers
KiWiX

Ooops: He said software is like ****, It's better when it's free.
I wanted to say SOMETIMES (and really only sometimes) software is better then ****. I found the bug and now I have to go to my wife :mrgreen:
Ben
Posts: 558
Joined: Wed 14. Jan 2004, 08:05
Location: Atlanta
Contact:

Post by Ben »

I know the Linus you are talking about (not personally), but what was he right about?
Post Reply