Where do I download PHP extensions for windows? - php

I'm trying to make my PHP installation to work with PostgreSQL, so I need php_pgsql.dll
A very dumb question, but where do I get one for my PHP5.3?
I have read here: http://php.net/manual/en/install.windows.extensions.php, but it is said that, yes, you need this dll, but no download link. What am I missing?
dll is not present by default in my installation:

extension is in ext subdirectory, to activate it you have to edit php.ini, set ext dir and uncomment php_pgsql

Related

Windows: How to install or activate SQLite3 for PHP

Any of the other questions are for Ubuntu only.
What I did:
In the php ini I uncommented this line: extension=sqlite3
as well as the one defining the extension_dir as ext
In PATH I added the PHP installation folder, which includes the libsqlite3.dll
"php -m" in a shell still does not show up sqlite3 (or anything similar) and any PHP file using SQLite3 results in the classic: "Fatal error: Uncaught Error: Class "SQLite3" not found in [php file]"
All the tutorials online (the two for windows that google can find) just say it's working after these steps (or even after the first).
TL;DR: You have the php_sqlite3.dll, right?
https://www.php.net/manual/en/sqlite3.installation.php
They state:
The SQLite3 extension is enabled by default.
and (this is the important part):
Windows users must enable php_sqlite3.dll in order to use this extension. This DLL is included with Windows distributions of PHP.
and (you followed that already I guess)
Note: Additional setup on Windows as of PHP 7.4.0
In order for this extension to work, there are DLL files that must be
available to the Windows system PATH. For information on how to do
this, see the FAQ entitled "How do I add my PHP directory to the PATH
on Windows". Although copying DLL files from the PHP folder into the
Windows system directory also works (because the system directory is
by default in the system's PATH), this is not recommended. This
extension requires the following files to be in the PATH:
libsqlite3.dll.
Other idea:
Did you edit the correct php.ini? There might be several. Where is php.ini?
The problem is in how the default windows .ini files are named
By default, the .ini files provided are named "php.ini-production" and "php.ini-development". Since they don't end with ".ini" they are not picked up and any edits ignored.
After renaming one to php.ini (and restarting) it finally worked.
In hindsight completely obvious but it just did not register with me for quite a while

Php unable to load firebird dynamic library

I have this problem, but the library it's on my ext folder.
I changed the php.ini file adding the driver.
The php_pdo_firebird.dll is only an interface between PHP and the firebird engine. So you need firebird installed and also the php-pdo-firebird.dll needs to be able to find fbclient.dll
Try copying fbclient.dll into \wamp\bin\php\php7.1.10
If you also need access from Apache you may need to copy fbclient.dll into \wamp\bin\apache\apache{version}\bin as well and also amend the php.ini file that controls PHP under apache. Do that by using the wampmanager menus to edit the correct php.ini file like this
left click wampmanager icon -> PHP -> php.ini

How to upgrade php version on Windows 10

I'm trying to get my Laravel project to work. But when I use composer update it says the following:
This package requires php >=5.6.4 but your PHP version (5.5.12) does not satisfy that requirement.
I'm using WAMP which runs php version 7.0.4 this is also confirmed in the browser if I echo the php version. But when I use php -v in the console it shows that I'm using PHP version 5.5.12 (cli).
I've searched a bit around on google and I found out that it uses my windows PHP version instead of my webserver's version. But I couldn't find out how to update my PHP version on Windows.
My PATH contents are as shown in the following image
You can uninstall composer, and while re-installing it will ask you to point at your PHP directory which is going to be C:\wamp64\bin\php (usually) at that point you can choose which PHP version you would want to use. good luck.
This means you have yet another installation of PHP in your system. Check your Programs in Control Panel and remove such installation.
However, you can modify your PATH environment variable as well. Procedure
Just remove the path that points to any PHP installation directory.
Else, otherwise, if you are unsure about changing the PATH variable (which can lead to serious problems if not set well), you can just delete the directory that the PATH variable points to.... (I mean the PHP directory)
The totally better solution is to add the path of your PHP7 bin directory at the beginning of the PATH variable. You should also make available composer in this PHP7 bin directory.
Such as, replace the C:\php in your path with C:\wamp\bin\php7 or whatever the location of the PHP7 path is..
To update PHP on Windows 10.
You must put the folder of the new PHP version in the same folder as the old.
You rename the old folder or you delete it, prefer rename the old folder,
now you write in a terminal console
php - v
PHP automatically check for a new version
if you had installed before xampp/wampp and composer globally you might had added php to you environment path to call it where ever you want, and now you want that composer use the new xampp with php the you recently installed, so go to system>advance tab> environment variable> maybe in PATH then search if you have something like C:\xampp\php and edit to your new php location.
I had multiple versions off xampp for testing and composer globaly instaled for php 7.2

Why does PHP refuse to enable cURL on Windows

I am using PHP 5.5.25 with Apache 2.4 on Windows 7 x64 and I am unable to activate the cURL module. I have looked around and tried all I could think of. Please assist:
In php.ini, the line extension=php_curl.dll is active and the file php_curl.dll is present in the extensions directory C:\php\ext
In php.ini when I set extension_dir = ext, none of the extensions load. I get several messages when Apache starts, similar to Unable to load dynamic libraryext\php_openssl.dll- The specified module could not be found.
When I use the full path and set extension_dir = C:\php\ext, all the extensions load fine, except for cURL. I get the error: Unable to load dynamic libraryC:\php\ext\php_curl.dll- The specified module could not be found.
I have tried renaming the extension to php_curl.new.dll and adjusting php.ini but I get an error message about the new filename. I have also downloaded a fresh new copy of the DLL from windows.php.net, but that made no difference.
I have checked the file permissions for php_curl.dll (Right-click on the file >> Properties >> Security tab) and they are the same as the permissions for extensions that load successfully
I have copied and pasted libeay32.dll and ssleay32.dll from the PHP bin directory to the System32 and SysWOW64 directories as instructed by a response to this question
I am certain that I am editing the right php.ini since the PHP startup error messages changed when I changed the extension_dir value from ext to C:\php\ext as I explained above.
I have made sure to restart the Apache server between php.ini configuration changes.
If in a PHP script I execute var_dump(file_exists('C:\php\ext\php_curl.dll'));, I get boolean True so PHP can see the file!
What else could explain why the cURL module is not enabled?
I think you'll need libssh2.dll in your PATH too.
Credit goes to #Steven Hilder for pointing me in the right direction.
The problem was that Windows could not see libssh2.dll, another DLL that was in PHP's directory. Copying this file to C:\Windows\SysWOW64 and C:\Windows\System32, along with the other two DLL files from my OP (libeay32.dll and ssleay32.dll) worked.
I am uncomfortable with this solution though because when the time comes to update to a new PHP version I will have a harder time remembering to overwrite these DLLs with the new version.
Therefore, I decided to remove all 3 DLLs from the System32 and SysWOW64 directories. Instead, I just added the PHP bin directory to the Windows' PATH variable, so that the next time the OS is looking for a missing file, it will also look in that directory. This has the added bonus that if a similar problem with another DLL occurs, it will be resolved automatically.
To add the PHP bin to Windows' PATH:
From the Start Menu search bar, search for and select Advanced system settings
Click Environment Variables. Scroll down the list of System variables to select Path and click Edit... to open the current PATH setting
Append ;C:\php or whatever directory has php.exe to the current setting (semi-colon is used to separate paths).
on windows the cURL execution wants SSL certificate. may be because of that others error is showing.
Put the below code before curl_exec(curlHandle) to ignore checking for SSL certificate
//to ignore the SSL certificate in windows
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER,false);

What php libraries need to copy to windows system dir and why?

As you know Apache couldn't load curl modules, when its dll's are not in windows system dir even when your php path exists in system variable PATH. I want to ask,
why it could happen?
do you know other examples of same behavior, when you need to copy anything in win dir?
ps,
PHPIniDir "F:/php" <- is set
PATH=F:/php
php.ini is in F:/php and it successfully loaded
never copy php files to widows folder:
1.- Add php to windows PATH
2.- change extension_dir to FULL PATH
3.- see phpinfo for more information, paths etc...
4.- to add module:
extension = module_name.dll in php.ini
good luck

Categories