mreiferson / php-wkhtmltox

PHP bindings for libwkhtmltox
MIT License
309 stars 60 forks source link

php command-line works fine, apache segfaults #27

Open ezp-matt opened 12 years ago

ezp-matt commented 12 years ago

I've compiled/installed php-wkhtmltox on MAMP 2.1.1 on OSX 10.7.4. I can run the test_pdf.php script via MAMP's command-line php and it works just fine, but when I attempt to load a script through MAMP's httpd (Apache/2.2.22) via a web browser, httpd segfaults.

Here's one of my httpd crashlogs: http://pastebin.com/mn2xe11P

I've compiled everything from source, as per the instructions here: http://marcus.bointon.com/compiling-wkhtmltopdf-on-mac-os-x-10-7-lion/

Any suggestions would be appreciated!

mreiferson commented 12 years ago

@matt-dns looks like this is beyond the scope of this extension but if I had to guess from looking at that stacktrace its failing to interact with the filesystem of some sort (inside Qt) - are you sure apache has permissions on whatever directory you're attempting to create the PDF in?

ne0c0de commented 12 years ago

@matt-dns hi matt,

could you please give a detail how to compile & install php-wkhtmltox on MAMP 2.1.1?

I want to do that but i didn't success.

mdesign83 commented 12 years ago

Last time i had segfaults because this page configuration: load.jsdelay = 0

I removed this configuration, and now it works. Previous version of ubuntu+qt+wkhtmltopdf setup does not raise this error.

ne0c0de commented 12 years ago

@mdesign83 which platform (operating system) do you use?

mdesign83 commented 12 years ago

ubuntu 10.04 32bit and ubuntu 12.04 64bit

ne0c0de commented 12 years ago

I'm too. But i want to transfer my development platform from Ubuntu to Mac osX 10.8.2

When i want to ./configure terminal gives that error: configure: error: libwkhtmltox version 0.10 or later required

did you get this error before?

mdesign83 commented 12 years ago

Yes, this is because the header files from the library not in the right place. Download the source (wkhtmltopdf-0.11.0_rc1.tar.bz2) from here: https://code.google.com/p/wkhtmltopdf/downloads/list

And copy the content of the include directory to your includes directory.

ne0c0de commented 12 years ago

made this but no success.

i copy this include directory to /usr/local/include and give .configure command but it gives 'configure: error: libwkhtmltox version 0.10 or later required' too.

then, i try ./configure --with-phpwkhtmltox=/Users/murat/Downloads/libwkhtmltox-0.11.0_rc1-amd64/include/wkhtmltox

command but no success.

mdesign83 commented 12 years ago

i dont know mac os enviroment, but on ubuntu these are the inital setup for compiling: /usr/local/include/wkhtmltox/converter.hh /usr/local/include/wkhtmltox/dllbegin.inc /usr/local/include/wkhtmltox/dllend.inc /usr/local/include/wkhtmltox/image.h /usr/local/include/wkhtmltox/imageconverter.hh /usr/local/include/wkhtmltox/imagesettings.hh /usr/local/include/wkhtmltox/loadsettings.hh /usr/local/include/wkhtmltox/multipageloader.hh /usr/local/include/wkhtmltox/pdf.h /usr/local/include/wkhtmltox/pdfconverter.hh /usr/local/include/wkhtmltox/pdfsettings.hh /usr/local/include/wkhtmltox/settings.hh /usr/local/include/wkhtmltox/utilities.hh /usr/local/include/wkhtmltox/websettings.hh /usr/local/lib/libwkhtmltox.so /usr/local/lib/libwkhtmltox.so.0 /usr/local/lib/libwkhtmltox.so.0.10 /usr/local/lib/libwkhtmltox.so.0.10.0

e-onux commented 12 years ago

ne0c0de murat kardes i know that error that why it's happening: 'configure: error: libwkhtmltox version 0.10 or later required' . You must sure that, fontconfig version is bigger than 2.4.2 and freetype version is bigger than 2.3.4. That's important.