I am trying to include the Zend_Service_Amazon_S3 file by using
require_once 'Zend/Service/Amazon/S3.php';
I have also included in the include path the directory where the entire Zend library is located, AND the installation is inside Zend Server CE (which includes the Zend Framework by default). However, no matter what I try, I only get the following for my troubles:
Fatal error: require_once() [http://php.net/function.require]: Failed opening required 'Zend/Server/Amazon/S3.php' (include_path='/usr/local/zend/apache2/htdocs:/usr/local/zend/apache2/htdocs/app/:.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/usr/local/zend/apache2/htdocs/app/vendors') in /usr/local/zend/apache2/htdocs/app/models/item.php on line 3
The Zend/Service/Amazon/S3.php is located under the paths:
/usr/local/zend/share/ZendFramework/library
/usr/local/zend/apache2/htdocs/app/vendors
Your error message says Zend/Server/Amazon/S3.php - Shouldn't it be Zend/Service/Amazon/S3.php?
Could it be the process that is running PHP does not have the required rights to read the file? Don't forget that a directory needs to be executable in order for a process to change to that directory (i.e. see the contents of its subfolders.)
Related
I am working on a Laravel implementation of AggCatAuth. When I try to load the page (hosted on a homestead vm), I get the following error:
main(): Failed opening required 'class.aggcatauth.php' (include_path='.;C:\xampp\php\PEAR')
The class AggCatAuth is referenced in the following block with config.php
require_once('config.php');
require_once('class.aggcatauth.php');
Config.php loads fine, even though both files are in the same directory and have the same permissions.
What are some reasons that a required file would fail to open?
The error message refers to "include_path='.;C:\xampp\php\PEAR'". Which file within the laravel framework specifies the paths to include?
I have not found a single file that lists all the paths to include, but I was able to find the files which specify include paths using the grep command:
Grep -rl . -e "set_include_path"
Likewise the paths which are already included can be determined by running
Get_include_path()
I have uploaded all my files in var/www/html and in one of my php files I have this line :
require_once('libraries/stripe/init.php');
the structure of my folders are list this:
www
-html/
-libraries
-> Stripe -> init.php
-register.php
I keep getting this error message:
Warning: require_once(libraries/Stripe/init.php): failed to open stream: No such file or directory in /var/www/html/register.php on line 116
Fatal error: require_once(): Failed opening required 'libraries/Stripe/init.php' (include_path='.:/usr/share/php:/var/www/html/') in /var/www/html/register.php on line 116
my php.ini file used to be like this
include_path= ".:/usr/local/php/pear/"
but based on some answers here i changed it to
include_path='.:/usr/share/php:/var/www/html/'
but it's not working!
Edit: in my libraries folder I have file called index.php the content is:
<?php
header("Location: ../"); die();
I wouldn't leave library paths to chance like that:
require_once(__DIR__ . '/libraries/Stripe/init.php');
This would make sure you include the script using the absolute directory path of the currently running script.
Update
Failed opening required '/var/www/html/libraries/Stripe/init.php'
Well, then the file is simply not there; if this file was generated by some other tool, e.g. composer, it would need to be done again on a new server (or ideally at every deployment).
i think the problem is my Stripe folder is in "s" but I'm using capital "S". is there anyway to make not case sensitive?
File systems under Linux are case sensitive by default (not even sure whether it can be changed) as opposed to Windows. Make sure you use capitalisation consistently.
That not what you are looking for. it says that php.ini file can't find the path of the file that you specified. that's why you should use absolute path to the file
require_once "path/to/file";
I installed the Jumi extension to Joomla.
I uploaded the php files and one css file that I need to make an addition to the website.
I put pathnames to them for example:
components/com_jumi/order_confirm.php
components/com_jumi/review.php
components/com_jumi/includes/formValidations.php
components/com_jumi/includes/config.php
Now the file order_confirm.php has code to require the formValidation.php file:
require_once ("includes/formValidations.php");
But when I create a new menu item that points to the php file review.php it outputs the following warning and error:
Warning: require_once(includes/formValidations.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/37/9463737/html/components/com_jumi/views/application/view.html.php(40) : eval()'d code on line 3
Fatal error: require_once() [function.require]: Failed opening required 'includes/formValidations.php' (include_path='.:/usr/local/php5_3/lib/php') in /home/content/37/9463737/html/components/com_jumi/views/application/view.html.php(40) : eval()'d code on line 3
Does that mean the paths that I wrote for each file in Jumi is not the actual path for these files?
Any help is much appreciated!
Thank you,
Al
I think it depends how you are using jumi extensions.
1. In case you are using it as a plugin, then you have to set the option 'Default Absolute Jumi Path' in Plugin Manager / System - Jumi
2. In case you're using it like a module - in Module Manafer / jumi-module / advanced options / Default Absolute Jumi Path
I've been trying to get to grips with zend framework and a bit of php and am having problems with (I think) some sort of path setting.
Basically I'm having some problems with getting a simple page to work.
I have a standard directory structure from the zend quickstart sample. It has the structure:
app
->public
->library
etc.
When I create the following "hello.php" file in the public directory, I get an error from "require-once"
Warning: require_once(/../application/Zend/Rest/Server.php) [function.require-once]: failed to open stream: No such file or directory in /home/bestpubi/public_html/svc/public/hello.php on line 2
Fatal error: require_once() [function.require]: Failed opening required '/../application/Zend/Rest/Server.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bestpubi/public_html/svc/public/hello.php on line 2
My hello.php file looks like this:
<?php
require_once '../application/Zend/Rest/Server.php';
/**
* Say Hello
*/
function sayHello()
{
return 'finally';
}
$server = new Zend_Rest_Server();
$server->addFunction('sayHello');
$server->handle();
?>
I could really do with some help as this is driving me a bit mad, and I'm sure it's something silly.
You are requesting the required library file as follows.
require_once '../application/Zend/Rest/Server.php';
The error message indicates that, there is no such file in the path specified.
Usuallay zend framework contains it 'Zend' library inside /library directory. If you have the Zend directory in your downloaded ZendFramework files, copy it to /library directory. So that the Zend directory structure would be as follows
/library/Zend
This is a simple way to get started. Once you are familiar with the environment, try to use include path in your setting.
Try
$new_include_path = "/home/www/app/library/";
set_include_path ( get_include_path() . PATH_SEPARATOR . $new_include_path); )
to define the include path of your ZF library. Put this on the top of your page, before Including any ZF file.
Edit:
I assumed you are on linux, if you are on windows, change path accourdingly
$new_include_path = "c:\\www\\app\\library";
Looking at your website it seems the index.php from /public works fine. So I would suggest copy pasting the code that's in there to set paths for zf into hello.php and it should work.
First thing is create your files in application folder.
And If You are using Linux follow the steps,
To use Zend library you can create a short cut to zend library from your library.
From terminal go to your 'library' directory run the command
ln -s 'path to your zend library'
It will create a shortcut.
i want to include a php file .module file like this using hook_init
function drupsocial_init() {
require_once base_path().(drupal_get_path('module', 'drupsocial') . '/libraries/dsinvoke.php');
}
but showing this error
Fatal error: require_once() [function.require]: Failed opening required '/drupal6/trunk/sites
/all/modules/drupsocial/libraries/dsinvoke.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs
\drupal6\trunk\sites\all\modules\drupsocial\drupsocial.module on line 32
how can i include such file
You normally can include any file if you know the full path of the file and the file is accessible. Check the path to the library, correct it and you should not have any problem.
Start with the full path to the file first. If that works, you can think about using a dynamic path to the file.
why drupal trying to load the file in the trunk directory ? are you working on a svn repo ? i think there's something wrong with that path.
I also suggest you to check permissions
Hope this helps