I using a new server (Rackspace, Ubuntu 10.04) trying to run a php file via linux shell, and the file uses MongoDB to insert and store information being collected. I keep getting an error that is defined in the MongoDB library I am using: "The MongoDB PECL extension has not been installed or enabled"
When I run the same file/script in a browser window, it runs just fine.
A few things to note:
MongoDB php extension is installed and enabled (confirmed via phpinfo)
Using CodeIgniter with the MongoDB library found here: https://github.com/alexbilbie/codeigniter-mongodb-library
Using the CodeIgniter cron job bootstrapper extension found here: http://codeigniter.com/wiki/Cron_job_bootstrapper
I've used all of the above together on a previous, different server without issues.
I'm new to configuring a server 100% on my own, can anyone help me understand why the MongoDB PHP extension would not be recognized when run via shell, but work when accessed via http? Would it be an issue with my server configuration, or does the problem have to do with the libraries I am using?
Ubuntu has two php.ini, one for Apache one for command line. If I remember correctly they are under:
/etc/php5/apache/..
/etc/php5/cli/...
Related
Hy! I'm trying to use oci on windows, I found some linked issues, but I don't have any xampp, or apache, or anything, I'm only using the php built-in server. I enabled the oci extension in the php.ini file, but it does not work. I was looking for answer. I don't need any oracle database, there is a database, I only want to connect it with my app. I have the error above every time, when I'm trying to run any php command. So it does not work. The missing dll file is there, so I don't understand, why is it missing. I installed pear, and pecl, but pecl installations need openssl, openssl needs visualC++ and some other things... is there any other solution? Even though why does it not find that dll, if it's there... I downloaded Oracle Instant client and Oracle SDK, I unzipped it, set the environmental variables, but nothing changed... Please, help!
You need to download the correct oci8_19.dll if not already there and placed it under your_xampp_directory\php\ext folder.
Enable/add this extension in your php.ini file.
Add environment variable path for PHP.
Then, you also need Oracle Instant client to load/run this properly. Download it from here. Be mindful about x86 or x64 architecture of your windows machine and download the one that matches your machine specs.
Add this Oracle instant client path too in your environment variable.
Restart command prompt and type php -v. Voila! It runs smoothly and shows you just the PHP version, which means your oci extension loaded properly.
I get the error when I open my VS. I´m working with, or on, files directly on the server, using SimpleFTP to synch between computer/Server. That means the files are loaded, and saved, directly from/to my server (yes, they are cached om the computer...).
This also means that a have the PHP installed on the server - not my computer/PC. Is it possible to use the server-installation of PHP, or do I need to install a PHP extension on my PC?
If I can use the server PHP installation - How do I set the path? I´m running Raspberry/Apache...
Hopefull for any respons...
using FTP you can only transfer/sync files. For running php command line is necessary. Better approach is to use ssh. On vscode using Remote - SSH official extension you can access complete developer environment.
I am trying to implement Elastic-search in my Laravel project but it is giving this error.
Elasticsearch-PHP requires cURL, or a custom HTTP handler.
I double checked it for cURL and it is loaded inside my php also I was previously working on some other project and send many requests to different API's through cURL and it is working over there but inside laravel it gives me this error.
Why my xampp is doing so and how can I fix this issue Thank you in advance.
I think you have multiple instances of PHP installed. Check your Windows Enviroment Variables, to see from where PHP is running. Assuming your using Git, do a php -v in your terminal to see which php version is loaded and check if it corresponds with the php from your xampp. Or delete xampp and install it in a new folder like, webserver/xampp. Enables the php modules, restart your apache and mysql and check your phpinfo().
I recently download PHP from here to install on Windows. I extracted all the contents of the file into a file called php located in C:\php. I added the path to the environment variables. I tried to run php -v on the command prompt but I get nothing, not even an error message. Am I missing something? Something wrong with the installation?
In order for PHP to be properly installed, I needed to have the Visual C++ Redistributable for Visual Studio 2012 installed. I did not have it installed but after all said and done I tried verifying if PHP is installed and it was.
Php is server side script that parses php code and return html output for your browser.
Get a web server and enable php. Try running php code on web server. point your browser to the location.
There are many free web servers available.
Im on Windows 7, 64/bit running xampp v3.1. The php version is 5.4, Im trying to install memcache locally on the box so I can use memcache with php. I have searched google and followed directions about installing memcached.exe as a service, then downloading the memcache dll extension file for php and putting it into the ext folder under the php folder. I then add it to the php.ini folder, restart apache and memcache does not show up when running phpinfo() and when I try to run memcache via php it tells me this function does not exist. Can anyone help me figure this out? I verified the service is up and running, I tried different versions of the dll php extension file but still same issue. Any suggestions? Here is one site I used for instructions on installing memcache:
http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/
There must be some error logged into your apache logs. What is the error?
Looks like I grabbed the incorrect version of memcache for php. You must grab the correct memcache dll file for the php version you are using. I found the correct download here:
http://windows.php.net/downloads/pecl/snaps/memcache/3.0.6/php_memcache-3.0.6-5.4-ts-vc9-x86.zip
It has the correct php version, 5.4 and its thread safe. Once I downloaded it, extracted the dll and put into php extension folder and restarted xampp/apache, it now works.