I need to call an API using PECL from my Server. I installed PEAR and PECL from the PHP PEAR Packages in Cpanel. .I attached the screenshot. But when I run my code $request = new HttpRequest(); it returns an error Fatal error: Class 'HttpRequest' not found in /home/wonr/public_html/sms_api.php on line 3
It is shared hosting.Is this causing because of the path error? Or do I need to do any additional setup on the Server?
I cannot find additional information on this.
Thank you.
Related
I am trying to configure MongoDB on the AWS server, but when I try to make an API call, I get the following error:
Fatal error: Class 'MongoDB\Driver\Manager' not found in /srv/www/api/releases/20160912135146/vendor/mongodb/mongodb/src/Client.php on line 56
I have done the following:
Install mongodb, following the instructions here -> install mongodb community edition on ubuntu
installed the php mongodb driver using pecl install mongodb
added extension=mongodb.so to php.ini at etc/php5/cli/php.ini
Started the mongodb service
on the server, I can enter the mongo console with $ mongo
What am I missing here, Please?
PS: the API is developed using Phalcon
I finally found a solution to this. Apparently, the apache server uses a special php.ini file, different from etc/php5/cli/php.ini. This file is located in etc/php5/apache2/php.ini. After installing the mongodb driver using pecl install mongodb, your extension should go in etc/php5/apache2/php.ini i.e add extension = mongodb at the end of etc/php5/apache2/php.ini. Good luck
After a backup recovery on my magento2 website I get this error:
Backend fatal error: PHP Fatal error: Uncaught Error: Class
'DOMDocument' not found in
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php:364\nStack
trace:\n#0
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php(109):
Magento\Framework\Config\Dom->_initDom('__construct('_createConfigMerger('Magento\\Framewo...',
'_readFiles(Object(Magento\Framework\Config\FileIterator))\n#4
/home/arredeom/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(269):
Magento\Framework\Config in
/home/arredeom/public_html/vendor/magento/framework/Config/Dom.php on
line 364\n
I've checked on cpanel config and on PHP Selector | extensions it says: Current PHP version: 7.0 and Dom is enabled (flag is on)
is there any way to fix it? thanks
PHP told you
Class 'DOMDocument' not found ...
The DomDocument class is a fundamental part of PHP's XML handling. If the DomDocument class is not present, that means whomever updated your backend server didn't include this fundamental part of PHP. This is common in some Linux package management features that slice up core PHP functionality so users can install only what they need.
The way to fix this is to install PHP's XML/DOM functionality. The way you do that will depend on which linux distribution you're using.
You need php-xml :
sudo apt-get install php-xml
i am hosting a website on hostGator with Linux cpanel.
i am using httpRequest and Curl functions in my php script. But when i put the script on Live Server it says,
Fatal error: Class 'HTTPRequest' not found in home/directory/file.php on line42
Any way to set up the server as i,ve update the php version to 5.5 on server from Cpanel.
How to configure these settings i have no idea.
Don't Link to these Questions not Helping in my case:
PHP Fatal error: Class 'HttpRequest' not found
HttpRequest not found in php
You can try this Alternative, as if you are on shared hosting you might not able to get the desired modules:
instead of httprequest use CURL which is built in php module, and easily enabled on linux hosting servers as well.
Check this out might be helpful.
Alternative for HTTPRequest in php
This is a pecl module that is apparently not installed on your server. You can either install via cPanel -> PECL or using the pecl cli pecl install
http://www.php.net/manual/en/install.pecl.php
Looks like I was wrong there does not appear to be a pecl manager in cPanel just pear.
So you need to ssh to the server and use the pecl command else write support#hostgator.com and request they install the extension for you
I have a fresh Ubuntu 12.04 installation with a basic web server setup including pecl and OAuth; However, when I run a simple index file (as shown below) I am getting a fatal error:
PHP Fatal error: Class 'OAuth' not found in /var/www/index.php on line 2
Here is my file:
<?php
$oAuth = new \OAuth(CONSUMER_KEY, PRIVATE_KEY);
Obviously the consumer/private keys are my actual keys.
Now I have checked phpinfo() and OAuth is definitely in there. I have it set in my php.ini. I have restarted Apache.
When I run pecl list
Installed packages, channel pecl.php.net
Package Version State
oauth 1.2.3
stable pecl_http 1.7.6 stable
extension_loaded('oauth') // returns true
there's no oAuth in php -m either
Any ideas why I am still getting class not found? I hope it's not something dumb I am missing :)
Cheers guys.
I get this error:
Fatal error: Class 'SoapClient' not found in /hoe/roits/wp.com/wp-content/plugins/Aggmges/classitle.php on line 51
Worpress doesnt seem to have the latest php installed as I understand. What can I do to install the newest php or make it so that the SoapClient will work in worpress?
http://php.net/manual/en/soap.installation.php
Install the php soap module if you don't have it, and make sure enabled in php.ini