I am trying to install pdflib on PHP 7.2 which I already had installed before. Somehow I restructured my PHP Installation with Homebrew a while ago. Before that restructure I had my extensions in /usr/local/etc/php/7.2/extensions. I just needed to reference my .so Files in php.ini and everything had been working just fine.
After the restructure I used pecl to install new extensions. Now I have my extensions in usr/local/lib/php/pecl/20170718 which is also referenced in my php.ini as extension_dir. But if I put the pdflib.so inside this directory and register it in php.ini I get the following error:
Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match`Warning: PHP Startup: PDFlib: Unable to
initialize module
How can I solve this or is there a way to roll back to the old configuration?
Module compiled with module API=20160303
PHP compiled with module API=20170718
this message indicate, that a PDFlib DSO is loaded, which was build for an older PHP (PHP 7.1).
I see two possible problems:
a different extension is loaded by accident. For example due to different names. (php_pdflib.so vs pdf.so)
your PECL build go wrong, and it was build the extension against the old PHP 7.1.
I would recommend
check your php.ini and remove all extensions with pdf
download the latest PDFlib 9.1.2 from the website and unpack the package
copy the correct DSO (php_pdflib.so) to your extension_dir
add now extension=php_pdflib.so to your php.ini
hope that helps,
Rainer
Related
I'm getting the below warning while adding the solr-client extinctions.
PHP Warning: PHP Startup: solr: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20121212
These options need to match in Unknown on line 0
can any one Please hep me out in this ?
PHP Warning: PHP Startup: solr: Unable to initialize module
1:Check extension_dir directive in php.ini. It should point to folder with 5.2 modules.
2:This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.
And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.
How to update your PHP extensions will depend on which system you are using.
If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.
If you are on Linux, you must either :
Check what your distribution provides
Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.
Hi I am trying to implement threading in php. What ever I have read till this point I got to know pthreads library can be used for this purpose.
I have gone through the php installation guide below :
http://docs.php.net/manual/en/pthreads.installation.php
After downloading pthreads windows installation zip I unzipped it & placed following files in respective locations :
Move
php_pthreads.dll to the 'bin\php\ext\' directory.
Move pthreadVC2.dll to the 'bin\php\' directory.
Move pthreadVC2.dll to the 'bin\apache\bin' directory.
Move pthreadVC2.dll to the 'C:\windows\system32' directory.
Configured php\php.ini and add
extension=php_pthreads.dll
But I am getting an error on server startup which is as follows :
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_pthreads.dll' - The specified module could not be found.
in Unknown on line 0
I am unable to detect what is the issue above file php_pthreads.dll is #given location, what may go wrong.
PHP Version of xampp : 5.6.15, Pthreads lib version : 3.1.0 both the softwares are for x86 architecture.
I made change as suggested by Saitama below, changed version of pthreads from 3.1.0 to 2.0.0 I got new warning as below :
PHP Warning: PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
How to I match these compile API version I have php extension build number as 20131226 but how to decide this number while downloading a pthread binary installation zip ?
The pthreads module can only be loaded if you are using the CLI SAPI.
And it is only available under CLI SAPI only.
Also, pthreads v3 is only for PHP7 and since you are using PHP 5.6 you need to use pthreads v2.
It is only available under the cli sapi because, spawning multiple threads under apache can prove to be buggy.
So, the problems are:
* You are trying to load pthreads under some another SAPI than CLI.
* You need to use pthreadsv2 rather than pthreadsv3.
Note: If you would be using pthreadsv2 you can most probably load pthreads under the apache SAPI. But still it is not recommended. Using some other approach would be highly recommended.
When start Apache I get this error..
How can I solve it?
PHP Warning: PHP Startup: ffmpeg: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20100525
These options need to match
extension=php_ffmpeg.dll : added to php.ini
php_ffmpeg.dll copied to php/ext
avcodex-51.dll/ avformat-51.dll/ avutil-49.dll/ pthreadGC2.dll : added to C:\Windows\SysWOW64
The php_ffmpeg.dll was compiled with an older version of PHP. It's possible your PHP installation was updated but the module was not. You will need to get an updated version the the php_ffmpeg module or remove it.
I have a problem with updating the pecl inotify extension.
but i think it applys to all extensions.
i recently updated my server.
first i got the error that inotify.so wasn't found.
so i copied it to the new php extension directory
#server:~# locate inotify.so
/usr/lib/php5/20100525/inotify.so
/usr/lib/php5/20121212/inotify.so
but now i'm getting the error:
PHP Warning: PHP Startup: inotify: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
so how do i update / reinstall / reconfigure these extensions?
the "long" way round.
pecl uninstall inotify
pecl install inotify
there should be a better way to reconfigure an php extension. right?!
but this works for now!
I have to use a PHP extension called ssh2: http://php.net/manual/en/book.ssh2.php
I downloaded the sources, and compiled them. Then I copied the .dll to my php ext directory. Then I added extension=php_ssh2.dll to php.ini and I restarted Apache2 and I got the following error:
PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_ssh2.dll' - The specified module could not be
found
It is weird because I have php_ssh2.dll on that path. Maybe I compiled it in a wrong way?
I am using xampp, by the way. The rest of the extension load correctly.