mosbth / cimage

Server-side image resizing and cropping on the fly with caching of generated image-files using PHP.
http://cimage.se/
MIT License
267 stars 43 forks source link

not working with php 7 #143

Closed githubmox closed 8 years ago

githubmox commented 8 years ago

not working with php 7

mosbth commented 8 years ago

Ok. Have not yet tested on PHP 7, besides running unit tests on travis.

What happens? Error output? How to repeat failure?

githubmox commented 8 years ago

Error output:

[img.php] img.php: Uncaught exception:

Target directory is not writable.

0 /var/www/html/images/imgd.php(3242): CImage->raiseError('Target director...')

1 /var/www/html/images/imgd.php(5045): CImage->save()

2 {main}

http://www.xxxxx.xx/images/imgd.php?src=1.jpg is working

http://www.xxxxx.xx/images/imgd.php?src=1.jpg&w=120&h=120 not working

thank you

mosbth commented 8 years ago

http://www.xxxxx.xx/images/imgd.php?src=1.jpg is working

This one does not, per default, create a new cached image in the cache directory.

http://www.xxxxx.xx/images/imgd.php?src=1.jpg&w=120&h=120 not working

This one creates a cached version of the image in the cache directory.

The error message is saying that the cache directory is not writable. This could be a configuration issue or an issue with PHP 7.

I will set up a test environment for PHP 7 and try the same thing.

You can try to do some tests on your own.

You can try to add &status to the link to get a verbose output saying if the cache directory is writable or not.

http://www.xxxxx.xx/images/imgd.php?src=1.jpg&status

You can see what kind of output to expect here: https://cimage.se/doc/check-environment Here is additional troubleshooting techniques: https://cimage.se/doc/troubleshoot

Note. The new documentation website for Cimage is work in progress.

githubmox commented 8 years ago

status output:

img.php version = v0.7.9* (2015-12-07) PHP version = 7.0.6 Running on: Apache/2.4.6 (CentOS) PHP/7.0.6 Allow remote images = Cache exists, not writable Cache remote does not exist Cache dummy does not exist Cache srgb does not exist Alias path writable = Extension exif is loaded. Extension curl is loaded. Extension imagick is NOT loaded. Extension gd is loaded. Array ( [GD Version] => bundled (2.1.0 compatible) [FreeType Support] => 1 [FreeType Linkage] => with freetype [GIF Read Support] => 1 [GIF Create Support] => 1 [JPEG Support] => 1 [PNG Support] => 1 [WBMP Support] => 1 [XPM Support] => 1 [XBM Support] => 1 [WebP Support] => [JIS-mapped Japanese Font Support] => )

directory cache has 777 permissions!

[root@centos7 html]# ls -la insgesamt 4 drwxr-xr-x. 5 root root 43 19. Mai 09:40 . drwxr-xr-x. 4 root root 31 19. Mai 08:04 .. drwxrwxrwx. 2 root root 6 19. Mai 09:40 cache drwxrwxrwx. 2 root root 6 19. Mai 09:40 dummy drwxrwxrwx. 3 root root 4096 19. Mai 09:20 images [root@centos7 html]#


Current PHP version: 7.0.6

Running on: Apache/2.4.6 (CentOS) PHP/7.0.6

Extension exif is loaded. Extension curl is loaded. Extension imagick is NOT loaded. Extension gd is loaded.

array(12) { ["GD Version"]=> string(26) "bundled (2.1.0 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(true) ["XBM Support"]=> bool(true) ["WebP Support"]=> bool(false) ["JIS-mapped Japanese Font Support"]=> bool(false) }

Checking path for postprocessing tools optipng: pngout: jpegtran:

githubmox commented 8 years ago

It's working now. thank you

Running on: Apache/2.4.6 (CentOS) PHP/7.0.6 :+1:

mosbth commented 8 years ago

Excellent!