I downloaded and installed PostgreSQL 9.2.3, which came with Stackbuilder.
I used the PostgreSQL Stackbuilder to install Apache (2.2.22) & PHP (5.4.5).
Now I'm trying to connect to a database with PDO, but I'm getting a driver not found error.
I've un-commented the extension=php_pgsql.dll & extension=php_pdo_pgsql.dll in my php.ini file.
My phpinfo(); function shows that they're enabled.
The main thing I'm noticing is that within my php\ directory there's no ext\ directory with these files. I would have assumed that these files would have been automatically installed to a php\ subdirectory.
Where could these extensions be stored; do I need to designate an absolute path for php to find them?
UPDATE:
So I went into php.ini and turned on Startup Errors. When I launch the commandline php.exe I get errors stating that php_pgsql.dll & php_pdo_pgsql.dll can't be found.
It looks like they're trying to reference them on a D: drive, which I don't have. I installed everything to the same directory on the E: drive. I can't find the extensions anywhere (and neither can php).
In Wamp (windows)...
copy C:\wamp\bin\php\php5.x.xx\libpq.dll
paste in C:\Windows\System32\
on Wamp, there are 2 php.ini files, you will have to check if the Postgresql extension is on both!
The extension line is
extension=php_pdo_pgsql.dll
So check on
C:\wamp\bin\apache\apache2.4.9\bin\php.ini
Also check on
C:\wamp\apache\apache2.4.9\bin\php.ini
After adding the extension line, restart Apache and it will work.
Related
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.
I know there's tons of topics about my problem, but I can't find a solution.
I'm using wamp and I've changed my version of PHP from 5.5.12 to 5.6.16, then when I go to localhost/phpmyadmin i have this error displayed :
Fatal error: Call to undefined function mb_detect_encoding() in
C:\wamp\apps\phpmyadmin4.1.14\libraries\php-gettext\gettext.inc on
line 177
So I update phpMyAdmin from 4.1.14 to 4.5.2.
And I have this **** error:
phpMyAdmin - Error The mbstring extension is missing. Please check
your PHP configuration.
My php.ini, phpForApache.ini is configured, I have un-commented the extension, set extension_dir to C:\wamp\bin\php\php5.6.16\ext, I stumbled on many topics/forum but none of the solution works.
Do you have any idea?
Please check #36254548
Copying the php.ini file to "wamp64\bin\apache\apache2.4.17\bin" has solved my problem.
Sometimes the extensions directory is well pointed to, the dll files have been uncommented but it still doesn't work.
The next solution to use, that is if your extensions directory is correct and dll files for the mbstring has been uncommented, then copy the php.ini file and paste it into the windows directory (i.e. C:\Windows).
You then restart your wamp/xampp and it will work.
check your php.ini file. In the extensions part of the configuration you should find:
;extension=php_mbstring.dll
remove the leading ';' to uncomment and enable the extension so it looks like this:
extension=php_mbstring.dll
restart your apache and it should work.
I faced the same issue when I start wamp, suddenly my project was not working and when I check the phpmyadmin, it gives the same above error.
My debugging process found php.ini file is missing. However I already installed two PHP versions, 5.6.19 and 7.0.4. I changed the version to 7.0.4 and then re-changed to 5.6.19. It started work.
What I guess, while changing the version, all the configuration files getting re-installed in wamp folder.
I am running on Windows 7 64 bit with:
Apache 2.2
PHP 5.2.8
MySQL 5.1 (essentials)
installed and configured manually. As you all know, for this since MySQL essentials has no GUI for interaction the best suit is PhpMyAdmin. I am trying to get phpMyAdmin-4.0.10.8-english, downloaded from the PMA website, into my Apache web server.
After all configuration work, now I get an error message when I try to log into PMA saying:
"The mbstring extension is missing. Please check your PHP
configuration."
In this forum it was mentioned that possible causes for this are the unavailability of php_mbstring.dll in php folder or else the extension_dir variable in php.ini is set to ./ which is the current folder.
I checked in the ext folder and the .dll file is available and the extension_dir variable is set to ./ext. And I tried setting the variable to C:/php/ext which is the absolute location, still it doesn't work. Any help on this concern would be much appreciated!
Probably the mbstring extension is just not activated in php.ini. Look for the line
;extension mbstring = php_mbstring.dll
and remove the leading ;
Also make sure that you are looking at the correct php.ini since there could be more than one in your installation.
I already uncommented in php.ini:
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
;extension=php_oci8_11g.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
Variables of the system set ok.
PHP version 5.4.16:
C:\wamp\bin\php\php5.4.16\php.exe
Add to System path variable:
C:\ProgramData\ComposerSetup\bin
But, recive this error:
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are
impossible. If possible you should enable it or recompile php with --with-openssl
I'm using:
windows 7
Wamp
php 5.1.16
apache 2.4.4
How solve this problem, please help me.
Open php.ini located in your "php" folder for example in xampp the file is in XYZ:\xampp\php\
Find "extension=php_openssl.dll"
";extension=php_openssl.dll" - remove ";"
Restart your xampp (or whatever u use), extension should be loaded after that.
Try agien to install composer.
ensure you are editing the php.ini locate on same place where is located php.exe, i was the same problem and wamp say the openssl is actived but Composer-Setup.exe used the php.ini in php directory/ext/ and wamp used C:\System...\php.ini,
Regards,
I have battled this several times. And this is the best solution I have found.
As mentioned, you need to ensure that extension=php_openssl.dll is enabled but doing just that sometimes may not resolve the error.
You should check that you have PHP on your path variable then see what INI file is loaded by typing php --ini in the console it should give you something like:
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\WINDOWS\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Make sure you are enabling the settings in the correct ini file. If you dont have an ini file loaded put an ini file from the php directory into c:\windows.
Also important
I find it helps to change the extension_dir flag to an absolute path from relative to makesure the system can find php_opensll.dll.
To do this uncomment the line starting extension_dir and change it to match from the drive root.
Example: C:\php\ext instead of ext/
For MAMP users, this is what worked for me.
If your php.ini is located under a \MAMP\conf\
copy the php.ini into a\MAMP\bin\php\php[your PHP version number]\
Restart MAMP and the command-line window
Go to a directory under a command-line window where you want to install composer
run from a command line:
php -r "readfile('http://getcomposer.org/installer');" | php
NOTE: it is http not https !
END
I figured it out and successfully installed Composer in My windows 10 PC.
I am sharing two solutions here.
There are some steps you have to follow in order to solve your problem.
1st solution.
Find and Open php.ini located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
Find "extension=php_openssl.dll"
";extension=php_openssl.dll" uncomment by removing the semicolon ";"
Restart your xampp , now extension should be loaded after that.
Try again now you are able to install composer.
2nd solution(If the above solution not work for you then go with below solution . )
This works in my case
Find and Open php.ini located in your "php" folder In my case it is in xampp the file is in c:\xampp\php\
Open SHELL from Xampp start panel by clicking on shell button.
Write php in shell and hit enter
If you get some waring message in your shell something like below .
Then you have to fix these waring message by commenting all these extension in your php.ini file.(Actually cause of these warning messages are because more than one time these extensions are enabled but you can un-comment it in php.ini file for solving the issue).
For Example which is in my case.
a). You can see in above image there is warning message for curl.
Module 'curl' already loaded in Unknown on line 0 .
b) To fix this find php_curl.dll file in your php.ini file and comment that extension by adding semicolon ";" in front of that extension like this ;extension=php_curl.dll
Follow above steps if you have more than one warning for each extension untill you are not getting any warning message in your shell.
Restart your xampp , now extension should be loaded after that.
Try again now you are able to install composer.
Hope I can solve your issue .
That's all folks . Happy coding !!! (amitamie.com) :-) ;-)
The problem solved after turn off windows firewall.
installation complete!
I nearly wrapped my head off trying to install composer on my windows 7 machine.
I was trying to install composer through the composer installer from getcomposer.org.
After the common openssl extension enabling (As above answers describing).
The installer has finished the installation successfully. But calling composer on the command line, wasnt
possible. It was telling me composer / application not found, check for typos etc...
Cant getting it running, I looked at the manually install guide and noticed something weird.
The doc said: "Close your current terminal. Test usage with a new terminal:"
I closed my terminal window. Opened a new one and IT WORKED!!!
I had a terminal window open during the composer installation. After that I was trying to call composer via the command line in this terminal. This didnt work.
So why did it not work?
The composer installer downloads the composer.phar file and sets a environment path to it. The terminal only gets the environment PATHS, when it gets started. So of course the path wasnt set for the terminal.
Solution:
If you have a terminal open before the installation just close it and open a new terminal window to get composer ready to use!!!
I hope I can save someone a couple hours of living time.
You can follow this guide:
http://abuango.net/2014/08/16/how-to-install-composer-on-windows-with-xampp/
Hope it helps you.
Find a php.ini in C:\wamp\bin\php\php5.4.16\ (the configuration file of PHP).
Remove ; in lines ;extension=php_openssl.dll and ;extension_dir = "ext". PHP will know that you are using a php_openssl extension and extension_dir is the location of extensions (you can see it in the comment above php_openssl).
Run the Windows command prompt with administrator permissions.
Execute the following command: mklink C:\Windows\php.ini C:\wamp\bin\php\php5.4.16\php.ini
Composer search php.ini in C:\Windows\php.ini and you have your PHP in WAMP. With mklink command you create a link php.ini that aim to your WAMP's php.ini.
i was facing the same issue but i fixed that,
if you are using wamp
goto your selected php version directory and then you need to edit that directory php.ini file
replace this line ;extension=php_openssl.dll to extension=php_openssl.dll and save and then restart then it will be working :)
Beside all of the above If php/xampp is not installed in c drive this problem occurred (what happened with me).
In that case please follow this link :
http://abuango.net/2014/08/16/how-to-install-composer-on-windows-with-xampp/
I was facing the same issue in windows 7 PC with xampp.
Cannot open '\xampp\php\extras\browscap.ini' for reading in Unknown on line 0
I just change the value of 'browscap' in php.ini file. Use full path instead of absolute path.
In my case Xampp was in E drive so I have changed
browscap="\xampp\php\extras\browscap.ini"
to
browscap="E:\xampp\php\extras\browscap.ini"
And it works for me!
I'm using a Windows 8 64-bit machine and a 32-bit version of WAMPServer
I downloaded the PHP drivers from Github https://github.com/mongodb/mongo-php-driver/downloads
Copied the .dll to C:\wamp\bin\php\php5.4.16\ext\
Added the line extension=php_mongo.dll to the php.ini file
I still get Fatal error: Class 'Mongo' not found
I echoed phpinfo() and the extension has not been loaded - it does not appear
Does anyone know how to fix this?
I can't add this as a comments because of low reputation.
Did u restart your server after updating ur php.ini file.
Had the same issue. Below steps solved my issue.
Make sure you have a 32 bit WAMP setup in place. Apparently, there are problems with 64 bit
Get the lates php_mongo driver from https://github.com/mongodb/mongo-php-driver/downloads compatible with your version
Rename it to php_mongo.dll and copy it to php extenstions folder. Default on windows is "ext"
check phpinfo()
Check for Loaded Configuration File variable. It gives you the path from where the php.ini file is read
Add the line extension=php_mongo.dll to the php.ini file in the above path
Restart your services
Looks like it can't load the Mongo Module.
First You have to download the stable dll zip file. PHP-MONGO
Download the Threaded-version of the module. Copy the dll file and paste it in C:\wamp64\bin\php\php5.6.19\ext (if wamp). then go to your php.ini file and paste the following script: extension=php_mongo.dll in the extensions row.
Note: There shouldn't be a ';' before the extension .
Then restart WAMP. In the wamp-php-extension menu you could find the php_mongo. tick mark it. Restart Wamp.
Start mongo and the try executing the following script.
<?php
if($connection = new mongoClient()){
echo "Connected Successfully";
}
?>`
Note: First start the Mongo server.
For more info: PHP/Mongo Manual
If you have problem in start Mongo then Write the command as follows in your Mongo/bin directory:
mongod --storageEngine=mmapv1 --dbpath [your-path]
your-path= The path you want to save the Databse files. (ex: F:\data\db )
The Mongo sever would be running now. Don't close the cmd.