I'm having a problem with sql server drivers for a php project, I follow the instructions given by the documentation on github, I added the dll's on the ext directory, changed the php.ini file and added the extensions like:
extension=php_sqlsrv_7_ts.dll
extension=php_pdo_sqlsrv_7_ts.dll
I restarted the pc and the server.
Php environment path is set and working.
however every time I tried to execute the server I get this error:
[Mon Nov 21 14:23:30 2016] PHP Warning: PHP Startup: Unable to load
dynamic library 'C:\php_7\ext\php_sqlsrv_7_ts.dll' - The specified module
could not be found.
in Unknown on line 0
[Mon Nov 21 14:23:30 2016] PHP Warning: PHP Startup: Unable to load
dynamic library 'C:\php_7\ext\php_pdo_sqlsrv_7_ts.dll' - The specified
module could not be found. in Unknown on line 0
What I'm missing
I managed to make it worke by using the non thread safe nts, instead of the thread safe ts
extension=php_sqlsrv_7_nts.dll
extension=php_pdo_sqlsrv_7_nts.dll
So I downloaded the php_ibm_db2.dll 5.6 Non Thread Safe (NTS) x86 extension from https://pecl.php.net/package/ibm_db2/1.9.9/windows, added it to php.ini and was getting the exact same error. In my case all I had to do was to downlaod the thread safe version of the lib: 5.6 Thread Safe (TS) x86.
Related
I was testing an application to see if it would work in 7.0.7 and 7.2.2. The app works in both; that's not where the problem lies.
After seeing the app works in 7.2.2 I changed the Windows Apache httpd.conf file to:
LoadModule php7_module "C:/php_7_0_7/php7apache2_4.dll"
PHPIniDir "C:/php_7_0_7/"
from:
LoadModule php7_module "C:/php_7_2_2/php7apache2_4.dll"
PHPIniDir "C:/php_7_2_2/"
After changing the paths I restarted Apache.
Going to the URL localhost the webpage comes up correctly.
Going to localhost/phpinfo.php does not come up. The error message is "The site cannot be reached." The file phpinfo.php is simply <?php phpinfo(); ?>
The Apache error file has the following:
[Thu Feb 01 16:03:48.820715 2018] [core:warn] [pid 7628:tid 780] AH00098: pid file C:/Apache24/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP Warning: PHP Startup: curl: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_fileinfo.dll' (tried: C:\php_7_0_7\ext\php_fileinfo.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_fileinfo.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_gd2.dll' (tried: C:\php_7_0_7\ext\php_gd2.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_gd2.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_intl.dll' (tried: C:\php_7_0_7\ext\php_intl.dll (The specified module could not be found.\r\n), C:\php_7_0_7\ext\php_php_intl.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_imap.dll' (tried: C:\php_7_0_7\ext\php_imap.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_imap.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: ldap: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mbstring.dll' (tried: C:\php_7_0_7\ext\php_mbstring.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_mbstring.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_exif.dll' (tried: C:\php_7_0_7\ext\php_exif.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_exif.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mysqli.dll' (tried: C:\php_7_0_7\ext\php_mysqli.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_mysqli.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: C:\php_7_0_7\ext\php_openssl.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_openssl.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_mysql.dll' (tried: C:\php_7_0_7\ext\php_pdo_mysql.dll (The specified procedure could not be found.\r\n), C:\php_7_0_7\ext\php_php_pdo_mysql.dll.dll (The specified module could not be found.\r\n)) in Unknown on line 0
PHP Warning: PHP Startup: pdo_sqlite: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: xsl: Unable to initialize module\nModule compiled with module API=20151012\nPHP compiled with module API=20170718\nThese options need to match\n in Unknown on line 0
PHP Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
When I use the command line and run php -i "print phpinfo();" -> delete.txt is run everything looks OK. The windows environmental variable path includes "C:\php_7_0_7"
This is the line that I thought would indicate trouble with the extensions:
extension_dir => C:\php_7_0_7\ext => C:\php_7_0_7\ext
That is the correct path to the extensions.
PHP Error Reporting is set to E_ALL (this is a development machine)
display_errors = On
display_startup_errors = On
When a file that is just phpinfo(); the site can not be reached. Running a file that uses the mysqli extension to connect to a database comes up with this error "Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in C:\www\mysqli.php:8 Stack trace: #0 {main} thrown in C:\www\mysqli.php on line 8"
When phpinfo is run from the command line and saved to a file it includes the lines:
mysqli
MysqlI Support => enabled
Which makes me think that php from the command line is working and there is some configuration or communication between Apache and PHP that I'm missing.
The service for IIS is turned OFF.
Edit 1: using the built in server started on the command line with php -S localhost:8000 everything works! However I would like to use Apache as that is what the main shop runs. Plus the port :8000 at the end of local host breaks the site.
Edit 2: When httpd.exe is stopped as a service and started by double clicking on it, everything runs just like it should. Perhaps this means there is a permission conflict between the service and the directories.
Update: works. does not work.
Is there an error log that is created when PHP starts?
How do I go about troubleshooting this? I'm on my 2nd hour and I'm seeking advice.
Thanks for all suggestions.
I had a very similar issue after upgrading my php, apache, and mysql stack. Specifically, everything seemed to work but none of the modules were available and I was sure the extension path was correct. When checking the error log I noticed similar entries to yours with file names like php_php_{module_name}.dll.dll.
During this process I copied an old php.ini file which listed module names like so:
extension=php_gd2.dll
;extension=php_gettext.dll
but when comparing to the php.ini-development or php.ini-production files, all modules are listed like:
extension=gd2
;extension=gettext
Just in case there were other changes that I missed, I ended up just copying the proper example file php.ini-development|php.ini-production and editing it to fit my environment again but you can probably get away with just removing the php_ and .dll segments from each of the extension listings.
Hope this helps someone else.
hi5, encountered the same exact problem today. Seems like lower Apache versions (I had 2.4.18) does properly load curl and openssl extensions. There's also an issue with new php.ini extension format (notice no "php_" and ".dll"), white readme states legacy format is still supported).
What solved my issue with two non-breaking steps:
Updated WAMP 3.0.2 to 3.1.1 using this
Updated Apache to 2.4.29 using this
Don't forget to switch Apache version in WAMP menu after restart and use new extension format in php.ini
I am just beginning with laravel. I followed all the steps mentioned in here: http://github.com/aimeos/aimeos-laravel and tried running the final project using this command:
php artisan serve
It is giving me an error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Laravel development server started on http://localhost:8000/
[Wed Apr 13 17:03:32 2016] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Apr 13 17:03:43 2016] 127.0.0.1:39822 [200]: /favicon.ico
[Wed Apr 13 17:03:43 2016] 127.0.0.1:39823 [200]: /favicon.ico
What should I do to resolve this error? I have installed mbstring library so I think it should've been able to find it.
I am using laravel 5.2.29.
EDIT:
I had uncommented the line:
extension=php_mbstring.dll
in my php.ini file which shouldn't be done if platform is UNIX. Now, when I run php artisan serve on terminal, it doesn't give any error. But when I go to localhost:8000, it says : Whoops! looks like something went wrong.
EDIT2:
Did everything according to suggestion.
Now the error is: No supported encrypter found. The cipher and / or key length are invalid.
What I have already tried:
'cipher' => 'AES-256-CBC',
php artisan key:generate
What can be done to resolve it?
Got my last problem resolved too.
The problem was that as #Bordon suggested, I had created a .env file. But when I ran the command:
php artisan key:generate
It created another file called .env.example. Now since I am a user of composer, I needed to rename it to .env (and remove the prev one).
So finally I renamed it, ran the above mentioned command again and now it works like a charm. Thanks a lot #Bordon for helping me out.
Also I would like to note that as #ash suggested, using Vagrant is quite a lot easier to me than xampp.
I am trying to install pdflib9.0.2 extension for my MAMP php5.5.10. I did the following steps.
Downloaded pdflib9.0.2 from http://www.pdflib.com/download/pdflib-family/pdflib-9/copied
created a folder "pdflib" in htdocs
found the extension_dir path from php.ini /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
copied /Applications/MAMP/htdocs/pdflib/bind/php/php-550/php_pdflib.so to /Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212
changed the permission to rw mode.
added extension=php_pdflib.so under "Dynamic Extensions" in php.ini
commented the following in /Applications/MAMP/Library/bin/envvars
#if test "x$DYLD_LIBRARY_PATH" != "x" ; then
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#else
# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib"
#fi
#export DYLD_LIBRARY_PATH****
But I could not see pdflib in my phpinfo()
I tried to access /pdflib/hello.php and I see following message in my apache error log
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/
I dont know where is going wrong.
I saw this version map in the doc. So I dont think there is a version mismatch.
bind/php/php-530 for PHP 5.3.0 and above
bind/php/php-540 for PHP 5.4.0 and above
bind/php/php-550 for PHP 5.5.0 and above
Can anyone one find out the issue here. Any input will show me a new path to solve this issue.
Thanks in advance.
I have added my Apache2 error log and php_error_log and I guess either one or both of these may be the reason for my unsuccessful installation of pdflib. If I can get some information to move forward to fix the issue, it will be very useful. Apache Error log [Tue Apr 15 11:38:22 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/.DS_Store
[Tue Apr 15 11:38:24 2014] [error] [client ::1] client denied by server configuration: /Applications/MAMP/htdocs/pdflib/bind/.DS_Store, referer: http:///pdflib/ php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
Your php_error_log tells:
php_error_log [15-Apr-2014 11:25:08 America/Los_Angeles] PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with build ID=API20121212,TS
PHP compiled with build ID=API20121212,NTS
These options need to match
This means that the PHP you are using is compiled "non thread safe", the PDFlib module you use is the "thread safe" variant. In a "non thread safe" php you can only use "non thread safe extensions. Sou you need to install the extension from the "php-550-nozts_VS11" directory of the PDFlib package.
I'm getting the below error in the logs after a reboot, prior to the reboot everything was working perfectly. It's running on a Win 2008 server.
I've tried absolutely everything but just can't figure out what's going on, any help greatly appreciated?!
[Fri Nov 08 11:07:06.787392 2013] [mpm_winnt:notice] [pid 4916:tid 616] AH00418: Parent: Created child process 1704
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/Program Files (x86)/PHP/ext/php_oci8_11g.dll' - The specified procedure could not be found.\r\n in Unknown on line 0
Found the answer, I've outlined it below.
If you've installed any other Oracle software on the same server, the instant client path has to be the first path in the environment PATH variable otherwise the OCI8 extension will use ORACLE_HOME as it is set by the first Oracle path it finds in the environment PATH variable.
You will need to reboot the machine after this to allow for PHP to pick-up the path changes.
I am trying to make use of the PHP driver for MS SQL Server version 1.0.
I have everything setup but I think I am having trouble loading up the extension php_sqlsrv_ts.dll. I have gone to the command line and try this:
C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv
Exception: Extension sqlsrv does not exist
C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv_ts
Exception: Extension sqlsrv_ts does not exist
In my PHP.ini - I have:
;extension=php_sqlsrv.dll
extension=php_sqlsrv_ts.dll
Thread safe is enabled for me hence the usage of php_sqlsrv_ts.dll. My extension_dir is correct because I load other modules from there. I also have Microsoft Native CLient 2008 too. Everytime I try to run my PHP script I get:
Fatal error: Call to undefined function sqlsrv_connect()
It must have something to do with the module not being loadaed up. I can get all extension info for MySQL but not for sqlsrv extension.
How can I get PHP to load this extension?
Thanks all
EDIT
Apache_Error_log:
PHP Warning: PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0
[Tue Oct 13 14:51:16 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Oct 13 14:51:16 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Oct 13 14:51:16 2009] [notice] Parent: Created child process 11916
PHP Warning: PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in <b>Unknown</b> on line <b>0</b><br />
PHP Warning: Module 'xmlrpc' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'xmlrpc' already loaded in <b>Unknown</b> on line <b>0</b><br />
That is a version mismatch. The module was compiled for an earlier version of PHP than is used for mod_php. You will need to compile the module using the version on the server.