-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php-vips has not been configured for PDF support #31
Comments
Hello @fsnightmckngbrd, My guess is your libvips build does not have PDF support, or you have a very old libvips. Is this a Debian-derived linux? Install
And paste what you see here. I see:
|
Hi sir, I guessed that libvips-tools was already installed so I tried the command you said and here is what I got.
|
Yes, your libvips has been built without PDF support. You will probably need to build libvips yourself. What OS and version are you using? |
This is what I got after I run lsb_release -a |
Yes, your libvips has no PDF support. You will need to build your own libvips library. Are you OK reading Dockerfiles? Here is a sample one for installing php-vips on Ubuntu 16.04 with PDF support. https://github.com/jcupitt/docker-builds/blob/master/php-vips-ubuntu-16.04/Dockerfile |
I'm not familiar with dockerfile but I've read from google that it's just a text file that contains several commands that will be executed similar to the one that you've referenced. Do I just need to run that dockerfile? Do I need to install something like a docker engine to be able to run that file? Thanks. Btw, I have an ImageMagick installed on the server that is used by another site, will that be a conflict? |
You can use the shell commands in the dockerfile as a guide when building libvips. First though you will need to make some choices about how you plan to install and deploy. Where will you keep the library? What kind of host will you use? How will you deploy to your servers? etc. |
Based on the dockerfile, I've found out that libpoppler-glib-dev is responsible for loading to pdf so I've installed it then tried re-installing the libvips and also the php-vips extension so it will detect poppler but it seems like I can't uninstall it. After uninstalling, phpinfo() still outputs that I have vips extension that doesn't support PDF load. Not sure if there are other vips installed, I've checked the list of packages installed and there's libvips42. I'm still planning to install it on our dev server which has an OS Ubuntu 16.04. I want to keep the library as similar to when it is installed through apt-get if possible. I'm still not familiar with linux servers so I'm having a hard time. |
It sounds like you are on the right track. By default, libvips will install to I would:
Phew! |
Okay, see here's what I did these past few days.
This is so tough for someone like me who doesn't have experiences using linux environment :( |
Oh dear, I'm sorry you are having such a hard time. It's honestly straightforward and logical, but you have jumped into the deep end and it must be tricky without a *nix background. Like all debugging, you need to go through the process slowly, step by step, and test for problems at each point. I would only use docker if you plan to deploy using a docker container -- I just mentioned the dockerfile as a guide to what you need to do. Assuming you don't want to deploy in docker, here are the steps to follow: First: you need to reset your system. Do you have other packages installed to Now get a fresh copy of the libvips source code. Remove any old
|
... so you should see this in the final summary table for
Plus a lot of other stuff too, of course. I'd also check that jpg and exif have been detected. |
Hello, seems like I finally installed it. So what I did was follow the dockerfile. I manually installed all the libraries included on the dockerfile, then I copied the bash file (install-vips.sh) that was included on the dockerfile. I ran the bash file then it successfully installed. I now have a vips version 8.8.3 and I checked the phpinfo(), I saw PDF support "yes". I'll update you again once I have tried the vips on php as I've got to go home :) Thank you for your patience. Gladly appreciate it. |
Well done! |
Okay so it's now working. Conversion is fast than Imagick but the server still hangs while the conversion is on-going. I have 32 pdf file with a total of 95 pages altogether. Should I open another issue and close this one? Thanks! |
Could you explain what you mean by "the server still hangs"? If you press a button on the page to start conversion, then unless you design your web application to process in the background, that page will be unresponsive until the conversion is finished. However, if you connect to the server from another tab, you should be able to view pages while the conversion takes place. So ... do you really see the server hang, or is it just the page where you do the conversion? |
I'm connecting through other tabs. I'm not sure what's the cause. |
You could ssh to the server and watch Is this apache? You could check the number of workers. It's usually five, I think. I'd be very surprised if someone has reduced it to one. |
Yes, this is apache. So I monitored I researched how to check number of workers but I got lost :D What I did was I went to the apache directory. Checked the mods-enabled folder and found out that the mpm I'm using is prefork. I read the conf file of prefork and here is the image. I also checked phpinfo(), thread safety is disabled. Will that be a problem? |
I've encountered an error while using php-vips and I'm encountering this error
vips_image_get: field "n-pages"
.I've followed all the instructions on the installation of this extension except for the composer. I installed the library using the command found on the composer
composer require jcupitt/vips
instead of adding"jcupitt/vips" : "1.0.0"
on my composer.json. I'm not sure if this is the problem. Thanks!The text was updated successfully, but these errors were encountered: