I get the following error when trying to execute a php script from cli as a non root user:
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20131226/PDFNetPHP.so’ - libPDFNetC.so: cannot open shared object file: No such file or directory in Unknown on line 0
My OS is a vagrant with Ubuntu 14.04 lts, php version is 5.6.8-1 . I am also using apache but this is not used because I am using the cli version.
Can you please check your php.ini (in Ubuntu it will most likely be at /etc/php/php.ini)? Can you please verify that your extension settings are correct - e.g. all the entries listed as “extension=/some/path/to/extension” are valid.
You will also need to make sure that all other entries are valid in the php.ini file. For example:
extension=/usr/lib/libPDFNetC.so
extension=
will not work because one of the extension has an empty entry. If one of the extensions are also pointing to a non-existent file, then you can possibly get the error you mentioned.
The PDFNetWrappers GitHub page has been updated, so that calling
sudo make install
will now place the PDFNetPHP.so into the PHP extensions directory.
This is done by calling
php-config --extension-dir
To get the path.
The PDFNetPHP.so file needs to be in the folder pointed to by ‘php-config --extension-dir’. It appears that this is not the case.
The other two files, PDFNetPHP.php and libPDFNetC.so, should be in the folder indicated by the LD_LIBRARY_PATH environment variable. In our samples this variable is set by the RunTest.sh file.