PHP extension loaded in command line (cli) but not loaded by apache - php

Final Update.
Problem Solved.
The way I solve the problem is re-install Apache and PHP entirely from source following the instruction by the following link.
http://dan.drydog.com/apache2php.html
Then do the extension by build the extension directly into PHP following the instruction by
the link down below.
The only thing is that the binaries are all only in the specific path, which I think is a easy problem to solve though.
Thanks everyone, this is my first post in Stackoverflow and I spend one whole day to make my first php extension. Though a little bit tough, but I like it! :D
Original Question
I'm trying to build a php extension following the instruction by the following link:
http://docstore.mik.ua/orelly/webprog/php/ch14_03.htm
I build the extension of 'rot13' into the php using the following steps
./buildconf
./configure --enable-rot13
make
sudo make install
Then I tested the extension by the command line php. The output is exactly the same as the above article.
I suppose after I build the extension into php itself, I don't need to care about the php.ini file. Then I try to test the extension in the browser, I find out that the phpinfo() page doesn't show any thing about the new extension whereas php -m command shows my extension is loaded. I checked the apache2 log, there is no error.
I googled for nearly one day and got no clue. Some threads are similar in stackoverflow but no real working solutions.
My system is Ubuntu 11.10 and php 5.3.10 and apache2.2.20.
If you guys have clues, please help. Thanks!
Update:
I did put the extension=rot13.so in the php.ini file at the path of /etc/php5/apache2/php.ini but now whenever I restart the apache2 server, I got the following error.
PHP Warning: PHP Startup: rot13: Unable to initialize module
Module compiled with build ID=API20090626,TS,debug
PHP compiled with build ID=API20090626,NTS
These options need to match in Unknown on line 0
Any one has any clue about what caused this fault?
BTW, when I compile the extension, I did use the ./configure --enable-rot13 --with-php-config=/usr/local/bin/php-config to make sure it uses the configuration file of php.
Update again:
I find out that the phpinfo() from the web page has different version of php -i I get from the command line... How strange is that? I'll try to google how to figure out this conflict.

In Ubuntu, there are 2 php.ini files, one for CLI and one for apache.
By default, they are located at /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini.
In your case, you need to enable the extension in apache2 php.ini file too.

Related

PHP Warning: PHP Startup: Unable to load dynamic library '/path/to/extension/mysqli.so' [duplicate]

I run a PHP script and get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0
What does that mean?
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
If you're on Linux, you can find all loaded configuration files by typing this in shell:
php -r "print phpinfo();" | grep ".ini"
UPDATE:
As mentioned in comments, this can be even more accurate:
php -i | grep ini
phpStom with XAMPP
TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file
I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:
extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"
to
extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"
If you just want to make the error disappear, and you don't need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.
There are various causes for this based on the exact module, but there are also some general guidelines.
Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.
For instance, /usr/lib/php/modules for Unix/Linux.
If the file does in fact exist, make sure permissions are adequate.
If the file does not exist, use the resources below to install it.
Installation on *nix (PEAR)
Installation of extensions on Windows
Loading .dll in Linux
I've encountered this warning message while I was trying to install a php-extension via the php.ini file;
until I figured out that you cannot load .dll extensions in Linux,
but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...
note: ... is the extension name you want to enable.
php -r "echo php_ini_loaded_file();"
Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.
In my case, this message started to appear when I updated the php version to 7.4.
To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.
Note that you can also get this error if your PHP library doesn't have the "other" directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called "volomike", that account didn't have permission to run the libraries that the php command relied upon.
For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:
sudo chmod o+x /usr/lib/php5/20121212+lfs.
Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.
I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.
I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'
I would install the library for the PHP version specifically:-
sudo apt-get install php7.1-xml
And then restart Apache. Fixed it for me. You can check your version like this:-
php -v
I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
now just find - is the current_xampp_containing_drive:\xampp exist?
if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
now again start the composer installation progress, i think your problem will be solved.
What I did was;
1 - I first find out what version of PHP I am using thru the function phpinfo()
<?php
phpinfo();
?>
2 - From there you will find the location of your configuration(php.ini) file
3 - Open that file
4 - Comment out the line similar to the image below
This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.
In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.
After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).
I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini
I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.
Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.
I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.
In Windows, it could be a wrong path in "System environment variables".
"Path" to the php.exe directory must be the good one.
'C:/PHP/5.2.13/ext\php_mcrypt1.dll'
I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).
Other than that make sure that php_mcrypt.dll and PHP:
Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.
From C:\xampp\php\php.exe I got
Unable to load dynamic library ''
C:\xampp\php\ext\php_.dll (The specified module could not be found.)
I solved by commenting out
C:\xampp\php\php.ini
;extension=
I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries ... it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something
Go to system env variable and set the php ext dir path as
C:\xampp\php\ext
basically it's finding the ext directory and then locating it's file but it's unable to find the files becuase php path is set as different.

ERROR: You must have the pdo_sqlite PHP extension installed (Windows) Drupal CMS

I am trying out the Drupal CMS, and I wanna try it out on my local computer first so I am following this guide: https://www.drupal.org/docs/official_docs/en/_evaluator_guide.html. Drupal requires PHP to run.
I installed php 8.0.3 for Windows Zip and put it in my path file so PHP works on the command prompt.
I also installed Drupal 9.1.5 unzipped it and am currently running commands in the drupal-9.1.5 directory.
I ran the command from this set up guide thinking it would launch drupal:
php core/scripts/drupal quick-start demo_umami
And the command prompt gave me the error:
[ERROR] You must have the pdo_sqlite PHP extension installed See
core/INSTALL.sqlite.txt for instructions, now I checked
so I headed over to INSTALL.sqlite.txt in the Drupal directory and it told me:
Windows
------- Read more about it on http://www.php.net/manual/en/pdo.installation.php
I went to the website and it says that the driver is enabled by default, but since I'm getting the error, it must mean I don't have it on PHP so it told me to head over to the php.ini file. In my PHP directory, since it's a newer version it has the php.ini-development file and php.ini-production file.
The windows fix says to simply uncomment ;extension=pdo_sqlite to extension=pdo_sqlite which I did for both php.ini-development and -production files. This is where I'm stuck. I did exactly what the error told me to fix and I am still getting it. How can I fix this?
I looked around and every solution for windows is to uncomment and I still get the error.
Another thing on the php manual states that extension=php_pdo.dll, but my php.ini file does not have the extensions. does that matter?
Here are my uncommented extensions which I thought could contribute to helping the error:
extension=php_pdo.dll
extension=pdo_sqlite
extension=sqlite3
One last attempt at trying to get this php command to work is installing the Windows sqlite binary and putting it into windows path (contains a dll not an exe), but that didn't help anything either.
How do I fix this. Thank you.
Hi just make a copy of "php.ini-development" and rename it "php.ini".
And uncomment the extensions you need.

php.ini extension not found Windows 10 [duplicate]

I run a PHP script and get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0
What does that mean?
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
If you're on Linux, you can find all loaded configuration files by typing this in shell:
php -r "print phpinfo();" | grep ".ini"
UPDATE:
As mentioned in comments, this can be even more accurate:
php -i | grep ini
phpStom with XAMPP
TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file
I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:
extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"
to
extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"
If you just want to make the error disappear, and you don't need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.
There are various causes for this based on the exact module, but there are also some general guidelines.
Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.
For instance, /usr/lib/php/modules for Unix/Linux.
If the file does in fact exist, make sure permissions are adequate.
If the file does not exist, use the resources below to install it.
Installation on *nix (PEAR)
Installation of extensions on Windows
Loading .dll in Linux
I've encountered this warning message while I was trying to install a php-extension via the php.ini file;
until I figured out that you cannot load .dll extensions in Linux,
but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...
note: ... is the extension name you want to enable.
php -r "echo php_ini_loaded_file();"
Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.
In my case, this message started to appear when I updated the php version to 7.4.
To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.
Note that you can also get this error if your PHP library doesn't have the "other" directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called "volomike", that account didn't have permission to run the libraries that the php command relied upon.
For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:
sudo chmod o+x /usr/lib/php5/20121212+lfs.
Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.
I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.
I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'
I would install the library for the PHP version specifically:-
sudo apt-get install php7.1-xml
And then restart Apache. Fixed it for me. You can check your version like this:-
php -v
I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
now just find - is the current_xampp_containing_drive:\xampp exist?
if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
now again start the composer installation progress, i think your problem will be solved.
What I did was;
1 - I first find out what version of PHP I am using thru the function phpinfo()
<?php
phpinfo();
?>
2 - From there you will find the location of your configuration(php.ini) file
3 - Open that file
4 - Comment out the line similar to the image below
This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.
In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.
After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).
I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini
I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.
Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.
I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.
In Windows, it could be a wrong path in "System environment variables".
"Path" to the php.exe directory must be the good one.
'C:/PHP/5.2.13/ext\php_mcrypt1.dll'
I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).
Other than that make sure that php_mcrypt.dll and PHP:
Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.
From C:\xampp\php\php.exe I got
Unable to load dynamic library ''
C:\xampp\php\ext\php_.dll (The specified module could not be found.)
I solved by commenting out
C:\xampp\php\php.ini
;extension=
I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries ... it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something
Go to system env variable and set the php ext dir path as
C:\xampp\php\ext
basically it's finding the ext directory and then locating it's file but it's unable to find the files becuase php path is set as different.

Disable error log file creation by php [duplicate]

I run a PHP script and get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0
What does that mean?
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
If you're on Linux, you can find all loaded configuration files by typing this in shell:
php -r "print phpinfo();" | grep ".ini"
UPDATE:
As mentioned in comments, this can be even more accurate:
php -i | grep ini
phpStom with XAMPP
TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file
I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:
extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"
to
extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"
If you just want to make the error disappear, and you don't need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.
There are various causes for this based on the exact module, but there are also some general guidelines.
Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.
For instance, /usr/lib/php/modules for Unix/Linux.
If the file does in fact exist, make sure permissions are adequate.
If the file does not exist, use the resources below to install it.
Installation on *nix (PEAR)
Installation of extensions on Windows
Loading .dll in Linux
I've encountered this warning message while I was trying to install a php-extension via the php.ini file;
until I figured out that you cannot load .dll extensions in Linux,
but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...
note: ... is the extension name you want to enable.
php -r "echo php_ini_loaded_file();"
Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.
In my case, this message started to appear when I updated the php version to 7.4.
To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.
Note that you can also get this error if your PHP library doesn't have the "other" directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called "volomike", that account didn't have permission to run the libraries that the php command relied upon.
For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:
sudo chmod o+x /usr/lib/php5/20121212+lfs.
Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.
I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.
I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'
I would install the library for the PHP version specifically:-
sudo apt-get install php7.1-xml
And then restart Apache. Fixed it for me. You can check your version like this:-
php -v
I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
now just find - is the current_xampp_containing_drive:\xampp exist?
if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
now again start the composer installation progress, i think your problem will be solved.
What I did was;
1 - I first find out what version of PHP I am using thru the function phpinfo()
<?php
phpinfo();
?>
2 - From there you will find the location of your configuration(php.ini) file
3 - Open that file
4 - Comment out the line similar to the image below
This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.
In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.
After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).
I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini
I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.
Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.
I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.
In Windows, it could be a wrong path in "System environment variables".
"Path" to the php.exe directory must be the good one.
'C:/PHP/5.2.13/ext\php_mcrypt1.dll'
I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).
Other than that make sure that php_mcrypt.dll and PHP:
Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.
From C:\xampp\php\php.exe I got
Unable to load dynamic library ''
C:\xampp\php\ext\php_.dll (The specified module could not be found.)
I solved by commenting out
C:\xampp\php\php.ini
;extension=
I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries ... it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something
Go to system env variable and set the php ext dir path as
C:\xampp\php\ext
basically it's finding the ext directory and then locating it's file but it's unable to find the files becuase php path is set as different.

How to update PHP and install ICU library on CentOS 6.x

I'm trying to install orocrm on centos server and it is asking for PHP 5.4 and ICU library 4.4. Although I updated PHP and restarted Apache my php version still shows PHP 5.3 if outputting phpinfo in a php page. But,if I use php -v command then it shows php 5.5
ini path is shown /usr/local/lib/php.ini if using php page but through command it shows /etc/php.ini
please help...
The PHP 5.4 you compiled is not getting picked up by Apache. Rather than figuring out how to point Apache to this installation, the easiest (and safer since you'll get security updates) is to use the IUS Community repository
I have a couple of thoughts. If you're on CentOS you're probably using YUM as your package manager. With it, you could remove the PHP's and add a new one (if you don't have active clients using it). You can search what PHP version yum has by doing one of these:
yum list
yum list installed
If it registers multiple versions, you can "yum remove $package".
If you're php -v showing version 5.5, then your path is set to include that. You can see that by typing $PATH from the command line when SSH'd in. In your ~/.bashrc (or ~/.profile) you can edit your $PATH by adding something like:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
EDIT: You should back up your PATH before writing a new one and after you edit it type "source ~/.bashrc" or "source ~/.profile" to make the command line see it.
You can also directly edit the php in the .bashrc to point to the correct version by setting up an alias (if you don't fix the root of the problem) like
alias php="/path/to/php"
You can see where your current php is by typing:
which php
Your PHP extension comes from the apache httpd.conf file. You can find it somewhere like /etc/apache2/httpd.conf. Search for "LoadModule" or "LoadModule php" and see which extension of PHP your apache is pointing to. It may still be pointing to an incorrect version.
To answer your question about ICU, it comes from the "intl" extension. With yum, this is probably called php-intl or php54-intl or php54w-intl. You can do something like "yum search intl" and it should give you the exact extension name.
I hope this helps!

Categories