powweb upgrade = gallery problem.
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
powweb made this announcment this morning: Quote:
PHP's default upload_tmp_dir was /tmp, which is no longer world writeable as this is where the worms using the phpBB exploit download their programs to spread. This was necessary to stop our servers from attacking others. Your scripts should not download files to this area anyways as it is not available on all the servers your site is hosted on. So If I open php.ini in /gallery and edit the line 'upload_tmp_dir = /gallery/tmp' which is the directory I created, there seems to be no change, I still get the error: Adding image.jpg I realize that may not make much sense to the error I am getting, but I was having no problems until powweb did their upgrade, somehow they must coincide. Any suggestions would be appreciated. ---- |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
Nice to see that hosts take this stuff seriously! You probably need the full system path, and not a relative one. Check FAQ Gallery:c.32 for a little script that might help you figure out the path. |
|
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
Thanks for the reply, h0bbel, I took your advice and added the full system path, and unfortuntely, it didn't make a difference |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
What is the error you get after the change? |
|
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
Same error as above Adding image.jpg |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
ok, try changing the upload_tmp_dir and set it to the same path as well, in php.ini |
|
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
Thanks h0bble, that didn't seem to make a difference, though. with debug mode on, the line 'The file /www/u/username/htdocs/gallery/albums/album01/image.jpg does not exist ?!' is added. I'm really stumped at this point. |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
are file_uploads even on in your php.ini? Seems like the file never reach the server when you upload. |
|
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
yes, it's definitely on. |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
could you link us to a file containing the following: <?php phpinfo(); ?> I would like to have a look at it |
|
smac1979
Joined: 2004-04-29
Posts: 29 |
![]() |
I found the problem. When modifying 'upload_tmp_dir' in the php.ini used with gallery, I left a semicolon in front of the line. I wasn't aware it was critical that that be removed. Thanks for much for your help, h0bble. For those of you hosted with powweb who run into this problem, you can find more information here: http://forum.powweb.com/showthread.php?p=259493&posted=1#post259493 |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
smac1979, the ";" makes it commented out, no wonder it didn't work! Glad you got it fixed! |
|
txcrude
Joined: 2005-01-02
Posts: 5 |
![]() |
yes, that did it. I had the same issue for a few days now and I thought the upgrade to the latest version would fix it, but it did not. The script to create a php.ini file and modifying the 'upload_tmp_dir =' line did it. Thanks everyone. TX |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
txcrude, glad someone used the search function! |
|
maxtech
Joined: 2005-01-04
Posts: 1 |
![]() |
This resolves the probelms at PowWeb and may resove problems elsewhere also, if you are getting this error message: Resizing/compressing original image I found this at B&T's site: http://www.prettyworthless.com/tips.php Using a custom php.ini file You may want to use a custom php.ini file in order to change some of the PowWeb defaults. For example, you may want to turn register_globals = off. If you copy the default PowWeb file, make changes, and then put it in your webspace, you may not know if PowWeb makes further changes to the default file which could cause your file to be out-of-date. A good solution is the following script, which you can execute manually or kick-off with cron each night. The script reads the PowWeb default file, makes your change, and writes it to your webspace. Now you can always have the current PowWeb default script with your changes made. The example below changes register_globals in the default PowWeb php.ini file. - - Start Script Here - - $replace = "register_globals = On"; $handle = fopen('/www/u/user/htdocs/php.ini', 'w'); You may want to change other things in php.ini as well. You can do this by repeating the center section of the script for as many changes as you wish to make. For example you may want to use your own directory for session files (in this example named sessions). In order to do PHP uploads at PowWeb you need to have your own temp upload directory (in this example named uploads). And if you want to change the maximum upload size to something larger than 2MB, also add the following: And if you want to go larger than 8M then also add the folowing: This script is an enhanced version of one posted by devinemke in the PowWeb Community Forum. <files php.ini> Here is a script to run on PowWeb, it places a custom php.ini file in your htdocs folder, just copy this script to a text editor and replace the * and ******* with the paths to your site. You can goto ops and ftp and see the correct paths to input into this script. Save it as something like customphp.php and upload it to your htdocs directory. Run it every couple of days by going to http://www.yoursite.com/customphp.php You should also make a .htaccess file with the entry above in it to prevent people from hacking your php.ini file. COPY FROM HERE > <? $replace = "register_globals = On"; $replace = ";upload_tmp_dir ="; $replace = "upload_max_filesize = 2M"; $handle = fopen('/www/*/*******/htdocs/php.ini', 'w'); < TO HERE I suggest increasing the max file size to 4M to allow for uploading images packed in zip files, just makes it easier to add images. Thanks go to B&T and the people who help support the community at PowWeb for this info. |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
Great! I've turned this thread into a sticky, hopefully more people will notice it. Thanks! |
|
nytephal
![]()
Joined: 2005-01-11
Posts: 2 |
![]() |
I've completed the above recommendations but still get an error: Warning: session_start(): open(/tmp/sess_f884c5d3c6e40dba9812858b06fc6965, O_RDWR) failed: Permission denied (13) in /www/u/username/htdocs/gallery/session.php on line 60 ***My initial and username was changed for this post... Do I need to CHMOD something differently? I have set 755 on my temp upload dir. Thanks! |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
Try setting the session_save.path to the same path as the temp upload dir in php.ini |
|
nytephal
![]()
Joined: 2005-01-11
Posts: 2 |
![]() |
Thanks...Jeez.. I've looked through every gallery php there is trying to find that path...who knew it was in the php.ini. :lol: It fixed her up though! |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
nytephal, great! |
|
Malka
![]()
Joined: 2004-12-06
Posts: 13 |
![]() |
Ok.. I'm reading this... and totally not understanding almost all of it! (a semi-newbie) but I lost totally another php applications to such hackers so I am concerned and want to do this right! Is there anyone I could pay maybe to help me with an upgrade if I need that? DRAT! I don't even know if I need one... this is SAD! If I haven't already bored you to tears... feel free to help! Thanks.. |
|
h0bbel
![]()
Joined: 2002-07-28
Posts: 13451 |
![]() |
worksoneimages
Joined: 2005-02-19
Posts: 1 |
![]() |
smac1979, I have had this program before and was set up by my webdesigner now i can't figure out the Instalation process i do have a site but the program will not load can you tell me why? |
|
andrewp00
Joined: 2005-10-05
Posts: 1 |
![]() |
I've been using Gallery for a year or two with no problems now on www.100webspace.com but I've recently started getting this same error message too. I don't have access to the php.ini on the server. I tried following the instructions above on creating your own php.ini via a script above but I think I'm missing something fundamental! Does this script need <?php bits at the start and end - I'm know pretty much nothing about php so I may be starting at completely the wrong end here.... |
|
rich zed
Joined: 2005-09-16
Posts: 5 |
![]() |
noticed! Thanks for Stickying it! |
|
JoJoC
Joined: 2005-10-30
Posts: 2 |
![]() |
Thanks! Josep |
|
ricardo1064
Joined: 2006-08-25
Posts: 7 |
![]() |
Ok, I have an interesting question. I am using Lunarpages as a shared host for the time being and do not see the php.ini file in any directory. Any suggestions are greatly appreciated. |
|