My Code:
// This should work.
$afile = "des/2/1/1.jpg";
$outpath = "des/2/1";
exec("./jpgtn -q 90 -s 100 -W -d $outpath -p t $afile");
Error_log:
./jpgtn: can't load library 'libjpeg.so'
I can't seem to create a .so (shared library) of libjpeg, and that's a different problem. jpgtn works on the command line even though libjpeg.so does not exists. I need to call it from PHP but I get the error above. Does anyone understand why it works from the command line but PHP is having trouble running it. I'm trying to get my ISP to help me compile a libjpeg.so file.
If anyone is interested in that problem, here is the email I sent them (I am a newbie unix guy)
==========================================
I am trying to build libjpeg.so. I'm new to unix but I read that .so means shared library. The instructions for creating the library are:
- If you want to build libjpeg as a shared library, say
./configure --enable-shared
so I do that. then I change the prefix in the Makefile to be:
/usr/home/iodis/usr/local
then I run make install.
I do not see a libjpeg.so file created like I need.
I am suspicious of the trace output from ./configure --enable-shared
as follows:
:
:
:
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking for BSD-compatible nm... /usr/ucb/nm -p
checking command to parse /usr/ucb/nm -p output... yes
checking how to hardcode library paths into programs... immediate
checking for /usr/bin/ld option to reload object files... -r
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
:
:
It says that libtool does not support shared libraries, and then the line that says, checking whether to build shared libraries ... no
I told it to build shared libraries, and I am wondering if the libtool shut down my request. Ultimately, I need to create a libjpeg.so file because another app needs it. I assume it has to be compiled on this server to ever work, and it is important, so I need to get over this hurdle. Compiling seems to be fine but I have not created the libjpeg.so file as needed.
Thanks for your help.