Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building PHP With pdflib Support - [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Fri Sep 09, 2005 7:48 pm    Post subject: Building PHP With pdflib Support - [SOLVED] Reply with quote

I have a Intranet web server that I recently upgraded php on. It had been a while and I can't say what the previous version of php was. The current version is dev-php/php-4.4.0. With the upgrade I lost pdf creation capability through pdflib. I checked the phpinfo and found that php was built without pdflib even though I have pdflib in my use flags. It appears as though building --with-pdflib is no longer an option.

Output of emerge -pv php is:
Code:

[ebuild   R   ] dev-php/php-4.4.0  +X +berkdb +crypt +curl -debug -doc -fdftk -firebird -flash -freetds +gd -gd-external +gdbm -gmp -hardenedphp -imap -informix +ipv6 +java +jpeg -kerberos -ldap -mcal -memlimit +mssql +mysql +ncurses +nls -oci8 +odbc +pam +png +postgres +readline -snmp +spell +ssl +tiff +truetype +xml2 -yaz 0 kB

Is there a new way of doing this so I have pdf support in php?

I really don't want to use a new package because I have several php pages that are already written to produce some forms through pdflib.

Thanks in advance for any help.


Last edited by WhimpyPeon on Tue Sep 13, 2005 12:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Fri Sep 09, 2005 9:17 pm    Post subject: Additional Information Reply with quote

OK I did some reading on the PHP web site and it looks like after version 4.3.9 you have to use PECL-pdflib.

I emerged PECL-pdflib and it looks like the extension pdflib.so was installed in:
/usr/lib/php/extensions/no-debug-non-zts-20020429/

Apache cannot load the extension and gives the following error:
Quote:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php/extensions/no-debug-zts-20020429/pdf.so' - /usr/lib/php/extensions/no-debug-zts-20020429/pdf.so: cannot open shared object file: No such file or directory in Unknown on line 0


I tried to copy the pdf.so file to /usr/lib/php/extensions/no-debug-zts-20020429/.

Now apache still cannot load the extension and gives the following error:
Quote:
PHP Warning: Unknown(): pdf: Unable to initialize module\nModule compiled with module API=20020429, debug=0, thread-safety=0\nPHP compiled with module API=20020429, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0


I really am not a guru on loading modules or setting up apache, but I am really stumped here.

Thanks for any help.


Last edited by WhimpyPeon on Fri Sep 09, 2005 11:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 958
Location: Portugal

PostPosted: Fri Sep 09, 2005 9:54 pm    Post subject: Reply with quote

i know this isnt what you want, but may i suggest using fpdf in the future, its written in php, and its more free than pdflib afaik
Back to top
View user's profile Send private message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Fri Sep 09, 2005 11:02 pm    Post subject: Reply with quote

Yes, I have been looking at fpdf and it actually looks much easier than pdflib. I will probably start using that in the future, but I have about a week or two of coding some complex forms into pdflib, and I really don't have the time to redo them right now. So if possible I would like to fix the pdflib issue first and then I can convert over at my pace.
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Sat Sep 10, 2005 11:57 am    Post subject: Reply with quote

The module loading error happens becuse in the old PHP ebuilds, php was compiled without ZTS, but mod_php with, thus there is no real consistency for modules: they may work on one PHP SAPI but not on the others.
Please upgrade to dev-lang/php as your PHP provider, these are the new PHP ebuilds that support this correctly. Also unmerge PECL-pdflib, and after having emerged dev-lang/php, use dev-php4/pecl-pdflib or dev-php5/pecl-pdflib, depending on wich version of PHP you emerged.
More informations on the upgrade can be found here: https://forums.gentoo.org/viewtopic-t-377385.html
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Sat Sep 10, 2005 7:57 pm    Post subject: Reply with quote

I am trying to stick with stable and emerge shows dev-lang/php as being unstable. I don't want to sound like a selfish crybaby, but isn't this why we stay with stable? Things should work. Ughhh.
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Sat Sep 10, 2005 9:16 pm    Post subject: Reply with quote

WhimpyPeon wrote:
I am trying to stick with stable and emerge shows dev-lang/php as being unstable. I don't want to sound like a selfish crybaby, but isn't this why we stay with stable? Things should work. Ughhh.


The old generation PHP packages simply are not ready for this and will never be made ready, the new generation ones are the way to go (dev-lang/php).
It is marked as unstable simply because it's new and it's Gentoo policy to wait about a month to be sure no big bugs are in the package. Actually dev-lang/php proved itself quite stable, only some GD/Jpeg/PNG problems were reported 'till now and we're resolving them, though these aren't related to dev-lang/php as far as I could debug them but seem general for PHP 4.4.0.
Have a nice day, CHTEKK.
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
WhimpyPeon
Apprentice
Apprentice


Joined: 18 Oct 2003
Posts: 158
Location: Columbus, Nebraska

PostPosted: Tue Sep 13, 2005 12:23 pm    Post subject: Reply with quote

Once the new php/apache setup is marked stable I will switch over to that. For now I have started converting my forms over to fpdf. It wasn't the solution I was looking for, but it will do. fpdf seems a little more "open source" than pdflib anyhow. The conversion to fpdf is going pretty fast IMHO it is much easier to work with than pdflib.

Thanks for all the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum