I'm using XAMPP with PHP 5.5.27 PHP and Windows 10 (x64). I'm triyng to install the YAML extention. Link from other topic is dead so I dowloaded files version PHP 5.5, x64, TS and NTS.
I placed file php_yaml.dll into c:\xampp\php\ext and yaml.dll files into c:\xampp\.
Then I added entry extension=php_yaml.dll just after extension=php_xsl.dll (as last entry of Dynamic Extensions.
At the end I restarted Apache.
Result is:
phpinfo() doesn't display info about YAML extention.
You want the Thread Safe(TS) version and as to 32/64bit it should match your XAMPP version rather than your OS version so if you have a 32bit XAMPP you need the 32bit php_yaml.dll Also you should only need to place it in the c:\xampp\php\ext folder
Also remember that there are 2 php.ini files. One in the c:\xampp\apache\bin folder that Apache uses and one in c:\xampp\php\php.ini, it is this one that controls PHP's config when being used from the CLI (Command Line Interface) So you also need to add the extension=php_yaml.dll to this php.ini file as well if you want command line PHP to load this extension.
To check which php.ini file is being loaded in the CLI do this from the command line
php -ini | more
Look for this entry
Loaded Configuration File => D:\wamp\bin\php\php5.6.15\php.ini
Check that yours says something sensible for your system
Related
so I need to use Intl extension and as usual I uncommented the line in php.ini file:
extension=intl
Then I try to restart the apache service from the Windows "Services" and a message appears giving me error #1067. If I try to start it from the command line, it seems to be working, even the log files don't report any error, but the service just doesn't start.
The only way I got it running, was launching it directly not as a service from the command line.
I've checked, and the php_intl.dll file is inside the "ext" folder, like all the other extensions that I've enabled so far.
Any ideas? I'm running on Windows 10.
The php_intl.dll needs to access the ICU dll set.
So look in your PHP folder for 4 files that start icu*.dll and copy those into your Apache\bin folder. Each time you change the version of PHP you are using you need to copy these files from the PHP folders to the Apache\bin folder as they change in different versions of PHP.
Because PHP runs in Apache when the intl dll needs access to these files it will look in the apache\bin folder
I'm having huge problems installing memcached extension for php.
Currently using:
OS: Windows 10 x64
PHP: 7.0.1 via XAMPP
Apache: 2.4.18 (Win32)
I have successfully installed memcached in C:/memcached the service is running.
But the problem starts when trying to add the memcache php extension. I've tried numerous versions of php_memcache.dll and non seem to be working. I did include the extension in php.ini extension=php_memcache.dll
When i run php -m memcache is not listed and at the top i recieve the error:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_memcache.dll' - The specified module could not be found.
And when I try running a test.php for memcache initialization i recive the Class not found exception
This is a huge problem, because I need it for running selenium tests.
The memcached service doesn't actually install the PHP memcached extension for you. It only installs the memcached server used to store your cache.
You'll need to download the Windows DLL from the PECL repository first (click on the blue Windows DLL link). Then you must add the extension=php_memcache.dll line to the correct php.ini file for your SAPI. Also, note the extension DLL file needs to be placed in the correct path for your XAMPP installation.
For Apache, simply create a script in your document root with the line <?php phpinfo(); and try loading that in your web browser. You should see a line at the top labeled Loaded configuration (php.ini) which gives you the full path to your loaded php.ini file. On Windows the path may actually appear different than what is stated in phpinfo() if you installed PHP through something like XAMPP. So you may need to rely on XAMPP to locate the correct php.ini file.
For the CLI SAPI, you can use php.exe --ini to do the same. Again, you may need to rely on the XAMPP package if it has modified your configuration path (since this is a compile time directive).
After making your changes to php.ini you will need to restart PHP for the changes to take effect.
Since you're using PHP 7 on Windows it's probably also important to note that the compiled DLL from PECL may not actually work under apache for Windows, because you're more than likely using a theaded SAPI. So make sure you are downloading the correct version. As far as I can tell that version is only compiled to work with up to PHP 5.6. The github alternative, for PHP 7, available at https://github.com/nono303/PHP7-memcahe-dll as mentioned in the comments is tested under non-thread safe. So you may only be able to get this working for your CLI scripts on Windows.
I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
Uncomment ;extension=php_curl.dll in php.ini
Uncomment ;extension_dir = "ext" in php.ini
Download and replace the php_curl.dll file in the ext directory of php with one from this website
Add to the PATH environment variable where php is installed
Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32
I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
Source
I give you an example of a set up that just worked perfectly for me :
downloaded the VC11 x86 Thread Safe version of PHP,
unzipped it within a directory C:\php,
edited the php.ini-development, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
saved this file under php.ini.
I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\bin\httpd.exe.
I fixed this problem by adding C:\php and C:\php\ext to PATH system variables.
Press window + pause to bring up the System Properties page.
Click Advanced System Settings
Click Environment Variables
You'll see the Path variable in the System Variables box in the bottom.
Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
e.g.:
extension_dir = "C:\PHP 5.6.19\ext"
I have php of version 5.5.12 and wamp version 2.4.9 and PHP Extension Build as API20121212,TS,VC11 . I am using this dll 'php_mongo-1.5.5-5.5-vc11.dll' (renamed to php_mongo) but still when i restart my all services mongo db is not displaying on phpinfo().Any pointer where m i going wrong ?
first of all you have to download the latest mongo dll files from
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
unzip the downloaded file and you will see a bunch of files like this:
now it is time to decide which dll file you have to use.
open your phpinfo() and search for word compiler. you will see sth like this:
so now according to my compiler version (MSVC11) I have to choose file with vc11 word inside their name. according to my PHP version which is 5.5.12 I have to choose file with word 5.5 inside their name.
now search for word thread safety in your phpinfo
and if it was enabled, it means that you have to choose file that doesn't have word nts inside their name but if your thread safety was disabled then you need to choose file with word nts inside their name.
now according to your installation architecture you may choose files with x86_64 inside their name.
after choosing the appropriate dll file, rename it to php_mongo.dll and copy paste it to your php extensions directory which is mostly located at
C:\wamp\bin\php\php5.5.12\ext
now open your php.ini file and add this at the end of it.
extension=php_mongo.dll
according to http://php.net/manual/en/mongo.installation.php
for installing mongo on windows, you have to also include libsasl.dll in your system PATH.
libsasl.dll file is mostly located at
C:\wamp\bin\php\php5.5.12
add this path to your system PATH.
reboot your wamp, refresh your phpinfo page and you should see sth like this:
which means that you have installed mongo correctly. :)
I have never used MONGO, but I was interested to see if there where problems using it with WAMPServer so I did a quick install to prove it shoud work, and it does.
Here is a list of what I did, I hope it helps you work out what you may have done wrong.
First you have to download the Mongo Database manager itself and install it.
Download from https://www.mongodb.org/downloads
Updated Aug 2019:
Download from here now
So you can place the software yourself I would download the ZIP and NOT the .MSI this way you dont get your system messed with by the .msi developer and what they think should be done to your system and you are in complete control.
Download the 32bit or 64 bit version to match your OS and WampServer(32/64) version you are running.
Now the Install is just a case of extracting the files from the zip and placing them somewhere on your system. I suggest :-
Copy the bin folder from the extract to c:\wamp\bin\mongo\mongox.y.z ( x.y.z to match the version of mongo you downloaded).
Create a data folder under that folder, so c:\wamp\bin\mongo\mongox.y.z\data
Create a data folder for your first database under that folder, so \wamp\bin\mongo\mongox.y.z\data\db
Create a config file for mongo in c:\wamp\bin\mongo\mongox.y.z\mongod.cfg and add as a minimum these parameter :-
NOTE: these are just params that will get it running, NOT A DEFINITIVE SET OF PARAMETERS!
systemLog:
destination: file
path: "c:/wamp/logs/mongod.log"
logAppend: true
timeStampFormat: iso8601-local
net:
bindIp: 127.0.0.1
port: 27017
storage:
dbPath: "c:/wamp/bin/mongo/mongo2.6.6/data"
directoryPerDB: true
Now if you want to have mongodb running as a service create a command file like so in the C:\wamp\bin\mongo\mongox.y.z folder :-
Filename = install_service.cmd
mongod.exe --config "c:\wamp\bin\mongo\mongo2.6.6\mongod.cfg" --install --serviceName wampmongodb --serviceDisplayName wampmongodb
sc config wampmongodb start= demand
The space between start= and demand is required, not a typo
For completeness also create an uninstall file :-
Filename = uninstall_service.cmd
mongod.exe --remove --serviceName wampmongodb
Now create 2 command files to start and stop your mongodb instance
Filename = start_mongo.cmd
net start wampmongodb
Filename = stop_mongo.cmd
net stop wampmongodb
Now start a command window using (Run as Administrator) and use these command files to install and start your MONGODB Server
CD \wamp\bin\mongo\mongox.y.z
#Install MONGO as a service
install_service
#Start the service
start_mongo
Now check the c:\wamp\logs folder and make sure there are no errors reported in the mongod.log file
While still in the command window, check that mongo is running by trying a few simple commands
Use the instructions here http://docs.mongodb.org/manual/tutorial/getting-started/ to prove that it is all working.
NOW ADD THE PHP Extension
Download from 'http://pecl.php.net/package/mongo'
Select the version you want and click the Windows icon with the word DLL beside it, in the 'Downloads' column.
This will take you to the download page for that version of the MONGO PHP extension.
You should now select the download link that matches the version of the MONGO extension you want, and the matching (x86) for 32bit WAMPServer installs or (x64) for 64bit WAMPServer installs.
You must click the 'DLL' link otherwise you will get a unix/linux source code.
Remember you must match the 32 or 64 bit to the version of WAMPServer you downloaded
So if you are running Windows 64bit but installed WAMPServer 32bit you need the 32bit version of the MONGO extension.
Also remember that you need the Thread Safe version (TS) to run with WAMPServer's Apache configuration.
Extract the zip file, and copy php_mongo.dll to your PHP folder eg C:\wamp\bin\php\phpx.y.z\ext
Edit your php.ini file to add the new extension.
To use Mongo with your web server (Apache) use the wampmanager menus to edit php.ini i.e.
wampmanager -> PHP -> php.ini
and add this line after all the other extension lines
extension=php_mongo.dll
To use mongo with scripts run from the command line (PHP CLI) edit C:\wamp\bin\php\phpx.y.z\php.ini and add the extension line again in there.
Start Wampmanager. Or Restart the Apache service.
This should refresh WAMPServers config and pick up the new PHP extension, if not do this when wampmanager is running:-
wampmanager -> Apache -> Service -> Restart Service
Run localhost by :-
wampmanager -> localhost
and then click on the phpinfo() link on the homepage.
You should now see a section entitled 'mongo' with some configuration options listed. If you do the PHP MONGO extension is active.
IMPORTANT
If you are running Windows Server 2008 R2 or Windows 7 you may have to install this HotFix to resolve an issue with Memory Mapped Files.
Request it from here http://support.microsoft.com/kb/2731284/en-us. You have to ask for it, and then they send you an email telling you where it can be downloaded from.
The link they gave me was http://hotfixv4.microsoft.com/Windows 7/Windows Server2008 R2 SP1/sp2/Fix405791/7600/free/451412_intl_i386_zip.exe
However I did not need to install it to get to the stage where MONGO was installed and running simple tests from the command line AND through Apache and PHP.
If you still facing the problem follow bellow two rules:
Make sure you downloaded drivers from
http://pecl.php.net/package/mongo
Try version 1.5.1 drivers (When I
am writing this the latest driver version is 1.6.8 but 1.6.8 to 1.5.5 nothing is worked for me)
Have you entered the .dll in your php.ini file (properly)?
http://docs.mongodb.org/ecosystem/drivers/php/
Scott
Updates for PHP 7 version.
As per documentation we have to download mongodb-1.2. You can download it from here based on your PHP version.
I followed the manual, I mpved the php_mongo.dll into the PHP extension folder,
and added extension=php_mongo.dll to the php.ini file and it's given me an error when I try and you rockmango that "To make things right, you must install php_mongo module. Here for installation documents on PHP.net." but I have alread done this any solutions? I am running the lattest version of PHP and mongodb
Check php --ini shows the correct config file being used.
Check php -i (phpinfo) and make sure the module is actually loaded.
Double check you have the right flavour of the module for your version of PHP. (VC6, VC8, VC9, TS, NTS, etc.)
I got my mongo module (1.2.9) for PHP 5.4 32bit on windows from stealth35. It works like a charm.
Often there are multiple PHP locations with different php.ini files.
If you are worried about working in mod_php (through apache) or as a fastcgi then create a file with the following contents.
<?php phpinfo();
Then visit that file in a browser. It will have all the settings and modules listed that are currently being loaded. It will also tell you which php.ini file and modules directory being used.
Please make sure that the ini listed is the one you added mongo dll line.