I'm sitting on it 3rd day and i have no idea what to do next.
I'm using XAMPP on Windows.
I've downloaded mongo.dll from here:https://pecl.php.net/package/mongo/1.5.5/windows - for php5.6, TS, x32.
i've modified php.ini file.
When i run "php -m" i can see "mongo" on modules list. But when i open my page, i see "Class 'MongoClient' not found" error message.
i've tried also to type "php install mongo" but after some time i see message "Package "mongo" Version "1.6.10" does not have REST xml available
install failed"
I have installed mongo on my computer, but i don't think it's realy needed since i'm going to connect to another computer in LAN.
[UPDATE]
When i run phpinfo by www, there is no mongo on list.
when i run php -i, mongo is there.
I could understand, if there was another php.ini for CLI and Apache, but there is no other php.ini on my computer.
Related
I was in need to install Php 5.6 with postgres. I followed the instructions from here and did:
brew install php56 --without-mysql --without-apache --with-postgresql
brew install php56-pdo-pgsql
Php 5.6 and postgres are running fine with my Projects using PostgreSQL.
Now there is some problem with Laravel projects using mysql. On running php artisan migrate command, it shows:
[PDOException]
could not find driver
Project works fine in the browser though. Data is being fetched perfectly from the mysql tables. php -m also does not shows mysql. But phpinfo does shows mysql module.
What could be the problem? Do i need to reinstall mysql?
Probably, you would need to activate mysql extension in php
Find your php.ini. Create a php file with following content and run it. It will tell you where it is.
<?php phpinfo(); ?>
Just look at the path of loaded configuration file. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini for Windows it may be C:\Users\username\PHP\php.ini
Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!
;extension=mysql.so
should become
extension=mysql.so
For windows it will be
;extension=mysql.dll
should become
extension=mysql.dll
Restart your apache service to load the new configuration.
I'm using Laravel 5 on my WAMP Server and I am trying to get sqlite to work on it so I can follow the tutorials properly. I've uncommented the following in php.ini and restarted the WAMP server.
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll
extension=php_sqlite3.dll
After restarting the server,
I've created a script to test if sqlite3 is supported or not located in C:\wamp2\www\laravel\test\test.php, and when I run it, the message says 'SQLite 3 supported.' So I know that it is working as far as that is concerned.
<?php
$dbname='base';
if(!class_exists('SQLite3'))
die("SQLite 3 NOT supported.");
$base=new SQLite3($dbname, 0666);
echo "SQLite 3 supported.";
?>
However, when I go into my database.php at: C:\wamp2\www\laravel\test\config\database.php and change the default to,
'default' => 'sqlite',
and then go into the cmd prompt to run the same command they do in the tutorial, which was: "C:\wamp2\www\laravel\test>sqlite3"
I get the error message
'sqlite3' is not recognized as an internal or external command, operable program or batch file.
In git it says:
Joe#JOEALAI /C/wamp2/www/laravel/test
$ sqlite3
sh: sqlite3: command not found
When my default was at 'mysql', it ran perfectly and I was able to connect and create tables no problem.
I am completely stuck. Is there anyone that has had this experience and can help me through this?
The test.php is just testing if the PHP module is installed.
I never worked with WAMP before but I'm pretty sure you need the actual sqlite3 programm installed on your server for the PHP module to work. Try downloading and installing the
Precompiled Binaries for Windows from their website.
So I've tried almost all the tutorials I've found here and on other sources but the problem is always the same. The extension is not installed when I call the phpinfo method.
I've added the file mongo.so to the extensions folder and I've called it on the php.ini as extension=mongo.so.
I'm using MAMP 2.2 on Mavericks and the php version is 5.5.3.
Appreciate any kind of help.
The output of phpinfo() will tell you which php.ini file (if any) is in use.
You have to modify that php.ini file and add extension=mongo.so and then restart your webserver.
One thing you need to keep in mind when you are installing the MongoDB driver for MAMP is the pecl command you are using is actually the MAMP command, not some alternative PHP install you may have on your system.
To do this, locate the PHP binary distributed with MAMP, and the use the full path to the pecl command of the MAMP installation.
I have two servers running. One on port 80 and other on 88. Now when i write command
'php composer.phar install' and expects packages mentioned in composer.json to be installed, i got the msg Composer supports PHP > 5.3.2 and u have 5.3.1.
The server at :80 has 5.3.1 but
the server at :88 has 5.4.16
How can i say composer to use port :88. Even though I am htdocs of :88 and running composer from there.
Thanks
I found the answer. It was when I ran the composer installer on windows, it selected the server with 5.3.*. I uninstalled it and re ran the setup, installed it, and selected the php.exe file of the other server. It works now. Thanks every body.
The Composer command line executable does not use any "ports" of webservers, it uses the CLI version of PHP. If your two PHP versions on your server both provide a php-cli executable, but the wrong is used when you call php -i, you should redirect the path to point to the other one.
I am attempting to configure PHP and Mongo DB to connect with one another and I'm having some troubles. Before I say the problem let me recap what I have so far.
I am using MAC OS X 10.6.8
I have mongo DB installed and working stand-alone.
I have enabled PHP on the default Mac OS Apache web server. It is working and the server recognizes PHP ( it is not allowing inline PHP scripts in HTML files...not sure if this an issue)
"Web sharing" works just fine.
I have installed pear via this url: curl -O http://pear.php.net/go-pear.phar
I have the pear folder and files accessible and have launched o-pear.php from a web browser.
I have gone through the step-by-step install process ( and removed any red displayed errors ).
Presumably Pear is now installed.
It says at the bottom of the install front end:
Note: To use PEAR without any problems you need to add your PEAR
Installation path (/Users/myname/Sites/PEAR) to your
include_path.
Using a .htaccess file or directly edit httpd.conf would be working
solutions for Apache running servers, too.
I am not sure what the code is I need to add for the httaccess rewrite.
As of this moment
Terminal does not recognize the pear command.
When I launch the pear "front end" from a web browser I get:
Fatal error: No PEAR.php in supplied PEAR directory: /Users/myname/Sites/PEAR in /Users/myname/Sites/index.php on line 24
Thank you.
That is all.
Create a new PHP file called phpinfo.php. Add the content <?php phpinfo(); ?> there. Run the script from within your webbrowser.
You should see a big page with PHP configuration information. Watch out for include_path. This is where your webserver/PHP module/process searches for include files.
You will also find Loaded Configuration File. This is the PHP configuration file being used. Open that file in any editor, and search for include_path again. Add /Users/myname/Sites/PEAR to the end of the include_path.
Restart your webserver. PEAR now should work.
If you need to install the MongoDB PHP extension, go for pecl install mongo from command line.