convert only work with full path
Posted: 2016-09-19T02:48:42-07:00
I really need som help here. I have a CentOS 7 server wich everything works correct on. But on my CentOS 6 server I have a problem that convert only works in shell and not in a php script.
I have upgraded to ImageMagick 7.0.3-0 and imagick 3.4.3RC1 , I am running PHP 5.6.26 and mod_ruid2
This code work in my webpages:
However this code does not work and give a blank page:
Also the last code give this error in apache error log: "no convert in /sbin:/usr/sbin:/bin:/usr/bin"
However if I run the PHP code from shell, it does work, it is only in webapges that it does not work. In order for it to work in webpages, I am forced to use the full path in the command. I have reinstalled many times and been struggling for a couple of days already. Strange thing is that it works correct on my CentOS 7 server, only in CentOS 6 server it does not work.
I have installed both imagemagick and imagick from source. Here is more output from my problem server:
It has worked correct on this server before, but I don't know what time it stopped working in PHP without full path, as I might not have tested that when I upgraded the last time.
Is there something wrong with my system PATH variable? Hope someone can help out here. Thanks!
I have upgraded to ImageMagick 7.0.3-0 and imagick 3.4.3RC1 , I am running PHP 5.6.26 and mod_ruid2
This code work in my webpages:
Code: Select all
<?php
echo "<pre>";
system("/usr/local/bin/convert logo: logo.gif");
echo "</pre>";
?>
Code: Select all
<?php
echo "<pre>";
system("which convert");
echo "</pre>";
?>
However if I run the PHP code from shell, it does work, it is only in webapges that it does not work. In order for it to work in webpages, I am forced to use the full path in the command. I have reinstalled many times and been struggling for a couple of days already. Strange thing is that it works correct on my CentOS 7 server, only in CentOS 6 server it does not work.
I have installed both imagemagick and imagick from source. Here is more output from my problem server:
Code: Select all
# php -i | grep imagick
imagick
imagick module => enabled
imagick module version => 3.4.3RC1
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0
Code: Select all
identify -version
Version: ImageMagick 7.0.3-0 Q16 x86_64 2016-09-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib freetype jpeg tiff x zlib
Code: Select all
# echo "$PATH"
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/root/bin
Code: Select all
# which convert
/usr/local/bin/convert
Code: Select all
# /usr/local/bin/identify -list configure
Path: /usr/local/lib/ImageMagick-7.0.3//config-Q16HDRI/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH /usr/local/lib/ImageMagick-7.0.3/modules-Q16HDRI/coders
CONFIGURE ./configure '--with-perl=/usr/bin/perl'
CONFIGURE_PATH /usr/local/etc/ImageMagick-7/
COPYRIGHT Copyright (C) 1999-2016 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick-7
CXX g++
CXXFLAGS -g -O2 -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib mpeg freetype jpeg ps tiff x zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-rsvg=no --with-perl=/usr/bin/perl
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-7
EXEC-PREFIX /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES DPC HDRI Cipher OpenMP
FILTER_PATH /usr/local/lib/ImageMagick-7.0.3/modules-Q16HDRI/filters
GIT_REVISION 11197
HOST x86_64-unknown-linux-gnu
INCLUDE_PATH /usr/local/include/ImageMagick-7
LDFLAGS -L/usr/local/lib
LIB_VERSION 0x703
LIB_VERSION_NUMBER 7,0,3,0
LIBRARY_PATH /usr/local/lib/ImageMagick-7.0.3
LIBS -ltiff -lfreetype -ljpeg -lXext -lXt -lSM -lICE -lX11 -lbz2 -lz -lm -lgomp
NAME ImageMagick
PCFLAGS -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX /usr/local
QuantumDepth 16
RELEASE_DATE 2016-09-19
SHARE_PATH /usr/local/share/ImageMagick-7
SHAREARCH_PATH /usr/local/lib/ImageMagick-7.0.3/config-Q16HDRI
TARGET_CPU x86_64
TARGET_OS linux-gnu
TARGET_VENDOR unknown
VERSION 7.0.3
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
FEATURES OpenMP
NAME ImageMagick
QuantumDepth 16
Is there something wrong with my system PATH variable? Hope someone can help out here. Thanks!