I have the following php code:
#!/usr/bin/php -q
<?php
require_once 'HttpRequest.php';
$r = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet.php", HttpRequest::METH_GET);
//$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-test.php", HttpRequest::METH_GET);
$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-dev.php", HttpRequest::METH_GET);
when I run this I get the message:
PHP Fatal error: Undefined class constant 'METH_GET' in /home/jsnyder/jsonmaker/map.php
Fatal error: Undefined class constant 'METH_GET' in /home/jsnyder/jsonmaker/map.php
do you know what is causing this error. I had to manually download a HttpRequest and put it in the directory that this program is in because I got the error:
PHP Fatal error: Class 'HttpRequest' not found in /home/jsnyder/jsonmaker/map.php
Based on the information I gave can you help me resolve this issue? How am I supposed to install HttpRequest so I can use this in my code?
Thank you for your help
had to manually download a HttpRequest and put it in the directory that this program is in because I got the error:
That sounds to me like you downloaded a random class with the same name somewhere and crossed your fingers it would work.
It's likely you simply have the picked the wrong library.
Related
When I tray to access my neo4j-DB via Graphaware's php-client using http-protocol, I get the following error message:
Fatal error: Class 'GraphAware\Common\Result\AbstractRecordCursor' not found in ...
On the other hand when I'm using the bolt-protocol t says:
Fatal error: Uncaught Error: Call to undefined method GraphAware\Bolt\Result\Result::getResult() in...
At the beginning of my code I have used
require_once 'vendor/autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
so I thought the classes should be autoloaded which is obviously not the case.
What's wrong?
I have solved this issue by replacing the respective syntax for queries of the example-files by one out of the README.
after trying different ways of using the API from sightengine I can' get it to work, I followed the instructions on their site , installing via composer, but when I try to use it, I get the Class not found error in apache:
PHP Fatal error: Uncaught Error: Class 'Sightengine\\SightengineClient' not found in /var/www/html/photobooth/app.php
PHP file:
<?php
use Sightengine\SightengineClient;
$client = new SightengineClient('xxxxxxx', 'xxxxxxxxx');
Missed to include the file.
When installing using composer, we have to include the file in our code
require_once 'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
This will help you to include the file in code, so you can start using the class/objects
So Im busy with this project that involves printing. I found a class online to do so. But when I try to test it, I get the following error:
Fatal error: Call to undefined function printer_list() in /Applications/XAMPP/xamppfiles/htdocs/barcode/Sample.php on line 9
And I know that I probably should install an extention, but how which one and how to do so? I use Xampp on OSX Yosemite.
The printer extension working only on Windows
printer_list() id deprecate in new php
I'm helping my brother but unfortunately, I'm very very new to Magento but I'm good in PHP and Unix.
I would like to ask what this error is and how to fix it.
Fatal error: Class 'Mage_Mtbelano_Helper_Data' not found in /home/scott/public_html/app/Mage.php on line 547
I am trying to use Swift_Validate::email($email) and I get a php error: PHP Fatal error: Class 'Swift_Validate' not found.
I have the latest version of swiftmailer. Is there some preference settings I need to do?
I have tried including the Validate.php file, but then I get the error: PHP Fatal error: Class 'Swift_DependencyContainer' not found.
I include DependencyContainer.php and I get the error PHP Fatal error: Class 'Swift_DependencyException' not found.
I include DependencyException.php and I get the error: Class 'Swift_SwiftException' not found.
I include SwiftException.php and I still get the same error.
I think I must not have the preferences set up correctly. I am calling:
"require_once($dir.'/swift/swift_required.php');"
The code I am using for the validation is:
if (!Swift_Validate::email($email))
{ $error = true; }
Any help would be greatly appreciated. Using latest Apache and PHP.
Try require_once dirname( __FILE__) . '/lib/swift_required.php'; to use the built-in autoloader, where lib is subfolder of folder where is the current file ( for default directory structure of the library )