I have a PHP project with the following structure:
Project structure
I'm getting this an error that says:
Warning: require(../app/view/home.php): failed to open stream: No such file or directory in /opt/app-root/src/index.php on line 22
Fatal error: require(): Failed opening required '../app/view/home.php' (include_path='.:/opt/app-root/src:/opt/rh/rh-php70/root/usr/share/pear') in /opt/app-root/src/index.php on line 22
Can anyone help me to resolve this issue?
Update:
Project structure on Openshift
Thanks in advance.
I see in you image of your folder structure you have folders for public and app containing the code, but the errors from your deployment look like the code is no longer in public public but in src.. are you sure the relative links are still correctly configured?
Has index.php maybe moved to the root and the link to ../abc/xyz.php should be updated to abc/xyz.php?
Related
I have very basic knowledge of coding, I took a copy of our company's website to practice making changes to it.
But when I try to run it I get this error
Warning: require_once(/var/www/html/classes/database_class_pdo.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\HJ\top.php on line 10
Fatal error: require_once(): Failed opening required
'/var/www/html/classes/database_class_pdo.php'
(include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\HJ\top.php on
line 10
Please, can someone tell me the issue here?
Thank you.
It's because your php file is trying to open a file named /var/www/html/classes/database_class_pdo.php but cannot find it. Try to see if the path is correct or if the file exists.
I am uploading my Wordpress site to a hosting by ftp. It uploads well, but I see the following errors when I try to access the website:
Warning: require_once(/home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/real-estate-search.php): failed to open stream: No such file or directory in /home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/load.php on line 22
Fatal error: require_once(): Failed opening required '/home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/real-estate-search.php' (include_path='.:/usr/local/php5_4/lib/php') in /home/content/90/8733390/html/marreroinmobiliaria.com/wp-content/themes/realhomes/framework/functions/load.php on line 22
What could be? Any help will be appreciated.
it sounds like there is some part of the link before public HTML (the part before the domain name in the error message) that must be included in your php
I have Xampp running on Ubuntu 12.04. I have a php page in which i've included another file like include 'dbconfig.php'. But whenever I try to open the page I get an error like this:
Warning: require(1): failed to open stream: No such file or directory in /opt/lampp/htdocs/index.php on line 2
Fatal error: require(): Failed opening required '1' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/index.php on line 2
I have tried using the relative path, the full path and everything. I have also double-checked that dbconfig.php IS present in the same folder as index.php. I googled around a bit and i think the problem is that php is unable to open dbconfig.phpbecause of 'permission' issues.
I'm new to ubuntu, so I have no idea how to fix this. Can someone please help me out?
The code from index.php goes like this :
<?php
include 'dbconfig.php';
?>
I have applied the google map to my local server via Xampp. I have moved it to my web hosting server and I can not get it to connect to the databse. I was able to get other db connections to work but the issue here is I must be puting the file path in incorrectly. I am using the same file structure as on my local machine.
The Errors:
Warning: require(../includes/core/db/map_dbinfo.php) [function.require]: failed to open stream: No such file or directory in /home/xxxxxxx/public_html/includes/state_map/phpsqlajax_genxml2.php on line 2
Fatal error: require() [function.require]: Failed opening required '../includes/core/db/map_dbinfo.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxxx/public_html/includes/state_map/phpsqlajax_genxml2.php on line 2
Anyone know why it's throwing these errors now but not on local machine and how I can go about fixing it?
I really have no idea where to start or even how to word this question. Any help would be appreciated. Thanks
You are standing in .../includes/states_map/phpsqlajax_genxml2.php and trying to reach "../includes/core/db/map_dbinfo.php". If you go back one directory from states_map you get to includes, and then you try to find includes under the includes directory.
Change the include to ../../includes/core/db/map_dbinfo.php
Why this is happening? Probably because you on your local server has .../includes added in you r include_path in php, which then will try includes/../includes/...
All,
I have the following files:
builder.php
Oauth.php
twitteroauth.php
Within my builder.php page I have the following code:
require_once('twitteroauth.php');
Then in my twitteroauth.php page I have the following code:
require_once('OAuth.php');
All of these files are in the following path: wp-content/themes/alyeska/framework/frontend/functions
I'm testing this on my localhost and it works fine. However, when I upload all of these files to my webserver I get the following error message:
Warning: require_once(OAuth.php) [function.require-once]: failed to open stream: No such file or directory in /home/arokyne/website.com/wp-content/themes/alyeska/framework/frontend/functions/twitteroauth.php on line 10
Fatal error: require_once() [function.require]: Failed opening required 'OAuth.php' (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/arokyne/website.com/wp-content/themes/alyeska/framework/frontend/functions/twitteroauth.php on line 10
I'm not sure why I'm getting these errors since it works on my localhost. Can anyone point me in the right direction on how to fix this issue?
Thanks!
Two things jump to mind- make certain your path is correct, including the case sensitivity; also, make certain that the permissions on the file allow for the php server to read the file. A 644 mode should be sufficient, I believe; but, worst case, a 755 would definitely work.
And finally you may want to check whether your include path is correct.