I am trying to set up server side script code for DataTables. What I have done so far :
Downloaded SSP from package
Installed PEARL on PHP server
Changed PHP.INI file include_path to the pearl folder
Placed the SSP class inside the same folder.
I keep getting the error message :
PHP Fatal error: require(): Failed opening required
'\crm\maintenance\ssp.class.php' (include_path='C:\Program Files
(x86)\php\v5.3\pear\') in C:\IIS\CRM\maintenance\khalid.php
Thhis is how i am calling the ssp class
require( 'ssp.class.php' );
SOME ADVICE!
The above steps WORK. In editing the question I had noticed that i was trying to specify a path in statement below as such :
require( '\xxx\xxxssp.class.php' ); // this does not work
FOLLOW the steps as outline the question itself and it will work!
Related
I am new to PHP, so I apologize for my inexperience. I am working in a Windows 10 environment and have installed WAMP to serve Apache, PHP, and MySQL. I am creating some remoteObject webservices for an Adobe AIR app that will communicate with Zend using AMF, and I have created an index.php file to get everything in motion, but when I browse to the index.php file, I get all kinds of errors. Here is the index.php file:
index.php
<?php
require_once('Zend/Amf/Server.php');
require_once('HalfService.php');
$server = new Zend_Amf_Server();
//adding our class to Zend AMF Server
$server->setClass("HalfService");
//Mapping the ActionScript VO to the PHP VO
//you don't have to add the package name
$server->setClassMap("VOService", "VOService");
echo($server -> handle());
?>
My File structure is:
C:/wamp64/www/
ZendFramework/library/Zend/Amf/Server.php
zendamf_remote/index.php
HalfService.php
VOService.php
I tried to create a include_path in my php.ini file that looks like this, but it did not work:
include_path = “c:\wamp64\www\ZendFramework\library”
Finally, this is the error that I get when I browse to index.php in a browser:
( ! ) Warning: require_once(Zend/Amf/Server.php): failed to open stream: No such file or directory in C:\wamp64\www\zendamf_remote\index.php on line 2
( ! ) Fatal error: require_once(): Failed opening required 'Zend/Amf/Server.php' (include_path='�c:\wamp64\www\ZendFramework\library�') in C:\wamp64\www\zendamf_remote\index.php on line 2
Any help at all in getting this configured would really be appreciated. Thanks so much!
"In your question you appear to have smart quotes around the path, so that may be it. See if changing that helps. – Tim Fountain"
Thanks to Tim Fountain for answering this question, who noticed something I wouldn't have seen in a million years
I'm getting an error that class is not found, but I clearly have the right path for where it is located:
<?php
require_once('stripe-php-2.1.0/stripe/lib/Stripe.php');
Stripe::setApiKey('my_key');
var_dump($_POST['stripe-token']);
?>
Every article I've come across all claim that the problem is (not including the right path) in the require_one, include, or require. (I've tried all 3). But still no luck. My database calls follow the same format and my WAMP server has no problem creating my database class.
This is copied directly from my file explore (copy paste)
website\stripe-php-2.1.0\stripe\lib\Stripe.php
My php file that I am using to try and access Stripe sits in the same place as 'website'.
PHP version 5.5.12
tutorial references: http://www.larryullman.com/2013/01/09/writing-the-php-code-to-process-payments-with-stripe/
Other reference: http://www.youtube.com/watch?v=Lka_JBM9bbY
It's because it uses a namespace. Try:
\Stripe\Stripe::setApiKey('my_key');
It is better to initialize all classes.
require_once ("stripe_folder/init.php");
then use namespaces:
\Stripe\Stripe::setApiKey('key_key_key_key_key_key');
I am using dreamweaver on a Mac and am trying to save a file as "template.class.php" in the dreamweaver dialog box that opens up when you save something. Then in my script I am using the "include" construct to include the file as in:
require_once( $object . '.class.php' );
but am getting an error message
"Fatal error: Class 'template' not found in /Applications/XAMPP/xamppfiles/htdocs/xampp/web_development/MVC/registry/registry.class.php on line 28"
So i used notepad++ on windows to solve this problem which was that the files needed to be named "template.class" while still retaining the fact that it's a php file and not a Java class file. I want to know how I can do the same on a mac.
Any answers would be greatly appreciated!
We have the Zend Framework v2.0 setup alongside a WAMP setup. We have confirmed that our WAMP is working as expected with a test (echo) file in the localhost.
We would like to make an HTTP Request using the Zend Framework and PHP. Our .PHP errors out with the following:
"Fatal error: Interface 'Zend\Stdlib\DispatchableInterface' not found in C:\wamp\bin\php\zend-framework\library\Zend\Http\Client.php on line 32"
Here is our stripped down PHP file:
<?php
require_once 'Zend/Http/Client.php';
require_once 'Zend/Http/Response.php';
//...custom HTTP request here not tied to the error
?>
This file is located in: C:\wamp\www
The Zend Framework is located: 'C:\wamp\bin\php\zend-framework
It appears that our code is erroring out in the Client.php file when the Client file tries to implement the DispatchableInterface:
class Client implements Stdlib\DispatchableInterface
Our php.ini has the following setting for the include_path:
; Windows: "\path1;\path2"
include_path = ".;C:\wamp\bin\php\zend-framework\library"
Thank you for any help!
I've spent a lot of time troubleshooting this myself but none of what I've read solves my issue so I'm hoping I get some help here.
So anyway, I have written a PHP script that provides various functions to connect with Google Calendar. When I run this script directly using some inline test code to call my functions, everything runs fine. However, when I call the function from other scripts using 'require_once' to include it I get the following errors:
Warning: include_once(Zend\Gdata\Calendar\Extension\EventQuery.php) [function.include-once]: failed to open stream: No such file or directory in C:\Users\Luke Franklin\Clients\Tiers For Tea\Development\TiersForTea.com v1.1\lib\Zend\Loader.php on line 134
Warning: include_once() [function.include]: Failed opening 'Zend\Gdata\Calendar\Extension\EventQuery.php' for inclusion (include_path='.;C:\xampp\php\PEAR;C:\Users\Luke Franklin\Clients\Tiers For Tea\Development\TiersForTea.com v1.1\lib;C:\xampp\htdocs\TiersForTea.com\lib') in C:\Users\Luke Franklin\Clients\Tiers For Tea\Development\TiersForTea.com v1.1\lib\Zend\Loader.php on line 134
Your first thoughts might be that I'm not using the correct include path, but I have checked and rechecked this many times. I even tried hard coding the path. I'm quite sure that I'm using the correct path.
Now for the weird bit. If you look at the error you will notice the file Zend is trying to include: Zend\Gdata\Calendar\Extension\EventQuery.php. This file does not actually exist in the 'Extension' folder. It does exist in the parent folder though. If I just copy 'EventQuery.php' into the 'Extension' folder my script runs as expected. Weird, right?
So that does sorta solve my problem, but I would like to know what's going on here in-case it creates further issues. I should also note that I'm calling this script into an OpenCart module.
You might want to see some of my code so here's a snippet of the important bits, if you want more details just let me know:
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . realpath('\\lib') . PATH_SEPARATOR . "C:\\xampp\\htdocs\\TiersForTea.com\\lib");
require_once('Zend/Loader.php');
function connect() {
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
I doubt the error exists in any of the Zend files as you have indicated it works correctly in your isolation tests.
The error is thrown from Zend_Loader which means something in your code is making reference to Zend_Gdata_Calendar_Extension_EventQuery.
Check the stack trace for the error if available to pinpoint the location. If that's not available, do a global find for that string. If you find any matches, you will need to change them to Zend_Gdata_Calendar_EventQuery.
Update
Seems this is a known bug(s)
http://framework.zend.com/issues/browse/ZF-7013
http://framework.zend.com/issues/browse/ZF-11959
It's an issue when your code registers an error handler using ErrorException. Apparently it's fixed in the 1.12 branch but hasn't made it to a release yet.
There's a patch in the 11959 bug report that fixes the issue