PHP Classes

WKHTMLTOPDF support

Recommend this page to a friend!

      WKHTMLTOPDF HTML to PDF creator  >  All threads  >  WKHTMLTOPDF support  >  (Un) Subscribe thread alerts  
Subject:WKHTMLTOPDF support
Summary:Support with installation and WK parameters
Messages:39
Author:PHP-4-Business
Date:2012-04-11 07:51:43
Update:2014-01-10 12:54:43
 
  1 - 10   11 - 20   21 - 30   31 - 39  

  31. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2015-08-24 21:10:29 - In reply to message 30 from PHP-4-Business
Hi Geoff,

The command

mount -o remount,exec,suid /tmp

gives as result:

mount: /tmp not mounted already, or bad option

I checked the /etc/fstab file as suggested on the web page to which you included a link. There I found this line:

/usr/tmp /tmp simfs bind,rw,nosuid,nodev,noexec,relatime,usrquota,grpquota 0 0

So it might be that the /tmp directory was not executable after all. I assumed it was because its permission is 1777. I thought removing the 'noexec,' part would help. It didn't. Changing it into 'exec,' didn't help either.

Do you have any suggestions on what else I could try?

Thanks for your help,
Niek

  32. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2015-08-25 06:04:41 - In reply to message 31 from Niek Reus
Did you reboot after changing /etc/fstab?

You could try installing from a directory other than /tmp i.e. one which you know is executable.

  33. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2015-08-25 08:14:08 - In reply to message 32 from PHP-4-Business
Hi Geoff,

No I didn't. I just restarted the Apache server. Rebooting did bring me one step further. The command

phpize

was executed without errors. The next command

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1

brought a lot of code ending as follows:

checking for libwkhtmltox support... yes, shared
found in /tmp/wkhtmltopdf-0.11.0_rc1
found in /usr/local
configure: error: libwkhtmltox version 0.10 or later required
checking for wkhtmltopdf_init in -lwkhtmltox... no

So again an error. The next command

make

gave as result:

make: *** No targets specified and no makefile found. Stop.

So again I got stuck. I hope you can help me further.

Thanks for your time and effort,
Niek

  34. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2015-08-25 08:42:58 - In reply to message 33 from Niek Reus
Looks like it can't find your libwkhtmltox. Where did you put it? Is it in the same place as your other lib files? You may need to specify the library location (on the command line) for 'configure' if it's in a non-standard place.


(p.s. there's no point in running make until configure has completed without error)

  35. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2015-08-25 10:04:53 - In reply to message 34 from PHP-4-Business
Hi Geoff,

I didn't put libwkhtmltox anywhere else but where it arrives by following your instructions. I suppose the following commands handle this:

wget http://wkhtmltopdf.googlecode.com/files/libwkhtmltox-0.11.0_rc1-i386.tar.bz2
bunzip2 libwkhtmltox-0.11.0_rc1-i386.tar.bz2
tar -xvf libwkhtmltox-0.11.0_rc1-i386.tar

cp -v /tmp/lib/libwkhtmltox.so /usr/local/lib

So indeed there is a file libwkhtmltox.so. I found it in the following places:

/usr/local/lib/libwkhtmltox.so
/tmp/lib/libwkhtmltox.so
/var/tmp/lib/libwkhtmltox.so

Is this the file and are these the right places? If not how do I indicate where to look for it or where should I put it?

Best regards,
Niek

  36. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2015-08-25 10:59:54 - In reply to message 35 from Niek Reus
./configure --help

will tell you what you can specify.

Try adding
LDFLAGS=-L/usr/local/lib/


There's plenty of information on the internet on how to customize the GCC compiler for your particular server (it's really nothing to do with this PHP class).

  37. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2015-08-26 10:48:57 - In reply to message 36 from PHP-4-Business
Hi Geoff,

I'm afraid the extra LDFLAGS code doesn't help. Of course I'm also searching the internet for solutions as well as our previous conversations in 2012. So I looked at the config.log where I found the following:

configure:4309: cc -o conftest -g -O2 -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -lwkhtmltox >&5
/usr/bin/ld: skipping incompatible /usr/local/lib/libwkhtmltox.so when searching for -lwkhtmltox
/usr/bin/ld: skipping incompatible /usr/local/lib/libwkhtmltox.so when searching for -lwkhtmltox
/usr/bin/ld: cannot find -lwkhtmltox
collect2: ld returned 1 exit status

It seems that the libwkhtmltox.so file is incompatible. From information on the internet I understand that this file may be fit for a 32bit Linux server while I'm dealing with a 64bit Linux server. This would also explain why I did manage to install php-wkhtmltox on the other server in 2012, because that is a 32bit Linux server.

So if I'm right, could you tell me how to install a compatible version of libwkhtmltox.so, and if I'm wrong, do you have other suggestions on how to proceed?

Thanks again for your help.

Best regards,
Niek

  38. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2015-08-26 11:59:12 - In reply to message 37 from Niek Reus
It's beyond the scope of this PHP class to tell you how to compile 3rd party software on your particular hardware. I can only give you general guidance (as per the txt doc).

I suggest you try the software's home pages

wkhtmltopdf.org/
github.com/mreiferson/php-wkhtmltox

  39. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2015-09-03 19:09:27 - In reply to message 38 from PHP-4-Business
Hi Geoff and others who might be interested,

At last I managed to install wkhtmltopdf on my server. I got useful instructions on https://jaimegris.wordpress.com/2015/03/03/how-to-install-wkhtmltopdf-in-centos-6-5/.

I also installed php-wkhtmltox by mreiferson. I experienced a stranged bug there. When I tried the test with

php test_pdf.php

I got an error on the php.ini file for '&' on this line:

error_reporting: E_ALL & ~E_NOTICE

On the php.ini file on my other server this line reads

error_reporting = E_ALL & ~E_NOTICE

So there is a change here that php-wkhtmltox doesn't seem to be aware of. I could make it work by putting the line

extension=phpwkhtmltox.so

not at the end of the page, but at the beginning. This may be helpful for others who encountered the same problem.

Thanks again Geoff for your help and your good suggestions. Installing these kind of things always seems to be a hassle to me and I'm glad I succeeded in the end. I hope for the time being that I don't have to do it again.

Best regards,
Niek Reus

 
  1 - 10   11 - 20   21 - 30   31 - 39