Problem in Windows Server

See all posts Reply

Problem in Windows Server new!
by Jose, 7 years, 7 months ago
Hi!

First, sorry for my horrible english. I hope you can understand all.
I use class.upload.php for upload images in a project. When I did all the test in Linux Server, everything works fine, but when I moved the project to Windows Server....
I try remove the last character (the '\') but not work.
This is my $process->log.

Thanks thanks thanks!!

system information
- class version : 0.30
- operating system : WINNT
- PHP version : 5.2.5
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 16M (16777216 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
UNIX file() command not availabled
- Checking MIME type with mime.magic file (mime_content_type())
mime_content_type() is not available
- Checking MIME type with getimagesize()
MIME type detected as image/jpeg by PHP getimagesize() function
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : portada-disco.jpg
file_src_name_body : portada-disco
file_src_name_ext : jpg
file_src_pathname : C:\Users\IUSR_257_dosefes.com\AppData\Local\Temp\php5C04.tmp
file_src_mime : image/jpeg
file_src_size : 439233 (max= 16777216)
file_src_error : 0
- source file is an image
image_src_x : 1500
image_src_y : 1500
image_src_pixels : 2250000
image_src_type : jpg
image_src_bits : 8
process file to ../../img/banners/\
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ../../img/banners/\
file_dst_name_body : portada_disco
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : portada_disco.jpg
file_dst_pathname : ../../img/banners/\portada_disco.jpg
- portada_disco.jpg doesn't exist already
- ../../img/banners/\ is not writeable. Attempting chmod: failed
- error: Destination directory can't be made writeable. Can't carry on a process.
Reply
Re: Problem in Windows Server new!
by colin, 7 years, 7 months ago
I don't use Windows, and cannot test on Windows, but the class should be working.

Don't add the trailing slash anyway. According to the log, it looks like the directory you want to write images to is not writable. Make sure PHP can write into this directory.Reply
Re: Problem in Windows Server new!
by Jose, 7 years, 7 months ago
I can write in this directory, I have 777 permission.
If you see the log, the class add '\' after the route. Maybe is this? Any test there I could run?

Thank you!!Reply
Re: Problem in Windows Server new!
by colin, 7 years, 7 months ago
In the class code, can you remove this chunk of code, and try again?
if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
  if (substr($server_path, -1, 1) != '\\') $server_path = $server_path . '\\';
} else {
  if (substr($server_path, -1, 1) != '/') $server_path = $server_path . '/';
}
Reply
Re: Problem in Windows Server new!
by Jose, 7 years, 7 months ago
Nothing :( but the directory is writeable, I check this right now again!

system information
- class version : 0.30
- operating system : WINNT
- PHP version : 5.2.5
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 16M (16777216 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
UNIX file() command not availabled
- Checking MIME type with mime.magic file (mime_content_type())
mime_content_type() is not available
- Checking MIME type with getimagesize()
MIME type detected as image/jpeg by PHP getimagesize() function
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : portada-disco.jpg
file_src_name_body : portada-disco
file_src_name_ext : jpg
file_src_pathname : C:\Users\IUSR_257_dosefes.com\AppData\Local\Temp\phpC416.tmp
file_src_mime : image/jpeg
file_src_size : 439233 (max= 16777216)
file_src_error : 0
- source file is an image
image_src_x : 1500
image_src_y : 1500
image_src_pixels : 2250000
image_src_type : jpg
image_src_bits : 8
process file to ../../img/banners/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ../../img/banners/
file_dst_name_body : portada_disco
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : portada_disco.jpg
file_dst_pathname : ../../img/banners/portada_disco.jpg
- portada_disco.jpg doesn't exist already
- ../../img/banners/ is not writeable. Attempting chmod: failed
- error: Destination directory can't be made writeable. Can't carry on a process.Reply
Re: Problem in Windows Server new!
by Jose, 7 years, 6 months ago
Finally I found the solution! In a windows server is not enough the 777 permission, you need contact whit the hosting company and they make the change of permissiions.Reply