Can't PHP PostScript extension

Ucreation

Verified User
Joined
May 21, 2010
Messages
18
Dear,

A customer needs a PHP PostScript (PS) extension for generating some stuff.

I found a PECL extension that should work;
http://pecl.php.net/package/ps

But i can't get this one to work, and receive the following error;

Code:
[root@server5 ~]# pecl install ps
downloading ps-1.3.6.tgz ...
Starting to download ps-1.3.6.tgz (635,832 bytes)
.....................done: 635,832 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
path to pslib installation? : /usr/lib64
building in /root/tmp.pear/temp/pear-build-rootbrYi66/ps-1.3.6
running: /root/tmp.pear/temp/ps/configure --with-ps=/usr/lib
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for ps support... yes, shared
checking for ps files in default path... found in /usr/local
found in /usr
checking for PS_begin_pattern in -lps... no
configure: error: wrong pslib lib version or lib not found
ERROR: `/root/tmp.pear/temp/ps/configure --with-ps=/usr/lib' failed

The error indicates that the pslib is not installed, but i installed this one using YUM (EPEL repository) and the libs are located in /usr/lib and /usr/lib64 but the PECL installer won't do this.

Some server specs;
CentOS 5 x64
PHP 5.3.21 CLI
pslib-0.4.5-2.el5.x86_64 and pslib-0.4.5-2.el5.i386 installed
pslib-devel-0.4.5-2.el5.x86_64 and pslib-devel-0.4.5-2.el5.i386 installed

What can I do to install the PECL extension?

Thanks in advance!
 
Last edited:
Because you didnt install the right file. You need to install pslib-devel
 
Because you didnt install the right file. You need to install pslib-devel

Hi ChatWizrd,

I was forgotten to mention those packages also, the devel packages are also installed (i change my topic).
 
Last edited:
What do you get with this command:

Code:
ls -lah /usr/lib/libps.so*

I just tried to install it and it went fine.
 
What do you get with this command:

Code:
ls -lah /usr/lib/libps.so*

I just tried to install it and it went fine.

This is the output;
Code:
[root@server5 ~]# ls -lah /usr/lib/libps.so*
lrwxrwxrwx 1 root root   14 Mar 28 13:21 /usr/lib/libps.so -> libps.so.0.4.5
lrwxrwxrwx 1 root root   14 Mar 28 13:17 /usr/lib/libps.so.0 -> libps.so.0.4.5
-rwxr-xr-x 1 root root 193K Jan  6  2012 /usr/lib/libps.so.0.4.5
 
Maybe you can do:

Code:
cd /root/tmp.pear/temp/ps
phpize --clean

Or maybe you could even remove the whole tmp folder of ps so you can get a new clean configure. Normally I would try make clean to fix this, but not sure how to with pecl. I am not sure what its trying to look for and not finding. You could see if /root/tmp.pear/temp/ps has a config.log that you can look at to see what its trying to find.
 
Maybe you can do:

Code:
cd /root/tmp.pear/temp/ps
phpize --clean

Or maybe you could even remove the whole tmp folder of ps so you can get a new clean configure. Normally I would try make clean to fix this, but not sure how to with pecl. I am not sure what its trying to look for and not finding. You could see if /root/tmp.pear/temp/ps has a config.log that you can look at to see what its trying to find.

Tried that, but didn't work either, i didn't found any log files inside the tmp folders.

I tried it also on another CentOS 5 x64 box, same problems there...

Did you tried this also on a CentOS 5 x64 Box? I have also some CentOS 6 boxes, i will try it there.
 
I tried a CentOS 6 box, guess what! There it's working immediately.

Unfortunately my client needs this extension on a CentOS 5 box so I am not finished yet :(
 
I tried it on a centos 5.x i386 box. I will try it on my 5.x 64bit one.

Edit: It worked fine lol.

Code:
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading ps-1.3.6.tgz ...
Starting to download ps-1.3.6.tgz (635,832 bytes)
............................done: 635,832 bytes
5 source files, building
WARNING: php_bin /usr/local/php5/bin/php appears to have a suffix 5/bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
path to pslib installation? : /usr/lib
building in /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6
running: /tmp/pear/install/ps/configure --with-ps=/usr/lib
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/local/php5/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for ps support... yes, shared
checking for ps files in default path... found in /usr
checking for PS_begin_pattern in -lps... yes
checking for PS_begin_font in -lps... yes
checking for PS_glyph_show in -lps... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/libtool --mode=compile cc  -I. -I/tmp/pear/install/ps -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/include -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/main -I/tmp/pear/install/ps -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/install/ps/ps.c -o ps.lo
mkdir .libs
 cc -I. -I/tmp/pear/install/ps -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/include -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/main -I/tmp/pear/install/ps -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/install/ps/ps.c  -fPIC -DPIC -o .libs/ps.o
/tmp/pear/install/ps/ps.c: In function ‘zif_ps_open_memory_image’:
/tmp/pear/install/ps/ps.c:1341: warning: ‘zend_get_parameters_ex’ is deprecated (declared at /usr/local/php5/include/php/Zend/zend_API.h:229)
/tmp/pear/install/ps/ps.c: In function ‘zif_ps_delete’:
/tmp/pear/install/ps/ps.c:1649: warning: ‘zend_get_parameters_ex’ is deprecated (declared at /usr/local/php5/include/php/Zend/zend_API.h:229)
/tmp/pear/install/ps/ps.c: In function ‘zif_ps_setpolydash’:
/tmp/pear/install/ps/ps.c:1719: warning: ‘zend_get_parameters_ex’ is deprecated (declared at /usr/local/php5/include/php/Zend/zend_API.h:229)
/bin/sh /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/include -I/tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/main -I/tmp/pear/install/ps -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -o ps.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules  ps.lo -lps
cc -shared  .libs/ps.o  -lps  -Wl,-soname -Wl,ps.so -o .libs/ps.so
creating ps.la
(cd .libs && rm -f ps.la && ln -s ../ps.la ps.la)
/bin/sh /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/libtool --mode=install cp ./ps.la /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules
cp ./.libs/ps.so /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules/ps.so
cp ./.libs/ps.lai /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules/ps.la
PATH="$PATH:/sbin" ldconfig -n /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /tmp/pear/install/pear-build-rootZy5R4C/ps-1.3.6/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6" install
Installing shared extensions:     /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/
running: find "/tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6" | xargs ls -dils
112657256   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6
112657278   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr
112657279   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local
112657280   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5
112657281   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib
112657282   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib/php
112657283   4 drwxr-xr-x 3 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib/php/extensions
112657284   4 drwxr-xr-x 2 root root   4096 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626
112657277 148 -rwxr-xr-x 1 root root 145636 Mar 28 11:48 /tmp/pear/install/pear-build-rootZy5R4C/install-ps-1.3.6/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/ps.so

Build process completed successfully
Installing '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/ps.so'
install ok: channel://pecl.php.net/ps-1.3.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=ps.so" to php.ini
 
Back
Top