[31-Oct-2014 12:47:24 UTC] PHP Warning: include_once(../connect/con.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/denzw681/public_html/u/userPages/check_login_status.php on line 3
[31-Oct-2014 12:47:24 UTC] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening '../connect/con.php' for inclusion (include_path='.:/opt/alt/php53/usr/share/pear:/opt/alt/php53/usr/share/php') in /home/denzw681/public_html/u/userPages/check_login_status.php on line 3
[31-Oct-2014 12:47:24 UTC] PHP Notice: Undefined variable: con in /home/denzw681/public_html/u/userPages/check_login_status.php on line 26
[31-Oct-2014 12:47:24 UTC] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/denzw681/public_html/u/userPages/check_login_status.php on line 15
[31-Oct-2014 12:47:24 UTC] PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/denzw681/public_html/u/userPages/check_login_status.php on line 16
I have folders this way:
>> public_html/u/connect/con.php
>> public_html/u/userPages/check_login_status.php
>> public_html/u/userPages/php_parsers/photo_system.php
Not sure how to sulve this issue (
I can add the files code if needed to answer this question.
P.S. website is http://www.U.example.com/
You can try using the root of your site, with:
include_once($_SERVER['DOCUMENT_ROOT']."/u/connect/con.php");
Or you can use the magic constant:
define( 'ROOT_PATH', dirname( dirname( __FILE__ ) ) );
Source: PHP - Document_Root vs Sub-Domains
you to give correct path of connection Try
include_once('../../connect/con.php');
or would be better if define your site url in common file like header.php
define('SITEURL', 'http://example.com/u/');
and use this to include files
include_once(SITEURL.'connect/con.php');
Related
I have a project file, and is simple stucture
home/index.php
folder_1/file1.php
folder_2/file2.php
if in file1.php i use "require('../index.php');" and it's work,
but why i can't use a same sytax at file2.php?
it's a error :
[01-Feb-2017 03:02:58 UTC] PHP Warning: require(../index.php): failed to open stream: No such file or directory in /home/lingga/public_html/folder_1/file1.php on line 2
[01-Feb-2017 03:02:58 UTC] PHP Fatal error: require(): Failed opening required '../index.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/lingga/public_html/administrator/php/config/aplication-pack.php on line 2
I created a config file that has a variable I want to use as a constant.
<?php
$ROOT_PATH = 'C:/Users/me/Documents/app-qas.com/site';
?>
On a CLASS page where I want to use the variable I added the following before instantiating the CLASS:
include_once("config.php");
$root=$ROOT_PATH;
I made the appropriate scoping changes to the functions in my class as follows:
global $root;
include_once($root."/Library/API/database.inc.php");
When I run my app, it DOES perform all of the data connections it
is designed to do, BUT it STILL returns the following errors:
Warning: include_once(config.php): failed to open stream: No such file
or directory in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 5
Warning: include_once(): Failed opening 'config.php' for inclusion
(include_path='.;C:\php\pear') in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 5
Notice: Undefined variable: ROOT_PATH in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 6
Warning: include_once(/Library/API/database.inc.php): failed to open
stream: No such file or directory in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 112
Warning: include_once(): Failed opening
'/Library/API/database.inc.php' for inclusion
(include_path='.;C:\php\pear') in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 112
Warning: include_once(/Library/API/database.inc.php): failed to open
stream: No such file or directory in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 112
Warning: include_once(): Failed opening
'/Library/API/database.inc.php' for inclusion
(include_path='.;C:\php\pear') in
C:/Users/me/Documents/app-qas.com/site'\class\Posting.class.php on
line 112
If I comment out the include and hard code the $root it runs like before BUT it DOES NOT throw any errors:
#include_once("joblaunch.php");
#$root=$ROOT_PATH;
$root='C:/Users/me/Documents/app-qas.com/site';
I don't understand why it runs and throws errors when getting the variable from the config.php but runs and doesn't throw an error when hard coding the path.
if you define a constant instead of a variable, this problem should be solved,
definition
old:
$ROOT_PATH = 'C:/Users/me/Documents/app-qas.com/site';
new:
define('ROOT_PATH', 'C:/Users/me/Documents/app-qas.com/site');
usage
old:
$root=$ROOT_PATH;
new:
$root = ROOT_PATH;
[20-Feb-2015 17:45:02 Europe/Berlin] PHP Fatal error: Class 'Varien_Autoload' not found in /home/vzvutpbd/public_html/app/Mage.php on line 53
[20-Feb-2015 17:46:32 Europe/Berlin] PHP Warning: include_once(Mage/Core/functions.php): failed to open stream: No such file or directory in /home/vzvutpbd/public_html/app/Mage.php on line 49
[20-Feb-2015 17:46:32 Europe/Berlin] PHP Warning: include_once(): Failed opening 'Mage/Core/functions.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php:/usr/lib/php:/usr/local/lib/php:/home/vzvutpbd/php') in /home/vzvutpbd/public_html/app/Mage.php on line 49
Ensure that all files listed are there & have appropriate read permissions.
Magento - Wiki - Resetting File Permissions
This should resolve your issues, granted the files are indeed there.
I've installed restler using composer. I've set up a virtual host for it. I'm able to go to my localhost in my browser and it shows some informational pages but as soon as I try one of the APIs I get a server 500 error.
My PHP logs say:
Function main
Error Type E_ERROR
Source File /public/examples/_001_helloworld/index.php : 18
Error String Class 'Luracast\Restler\Restler' not found
I'm using the example code straight out of the project. It looks like it has the require_once '../../../vendor/restler.php' and it seems to still have 500 errors.
I'm using PHP 5.4.16 on a Mac.
Update
Here are all of my logs:
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_classmap.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_classmap.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_namespaces.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_namespaces.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_values() expects parameter 1 to be array, boolean given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 154
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #2 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #1 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_map(): Argument #2 should be an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_filter() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: natsort() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 167
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_unique() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: implode(): Invalid arguments passed in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170
[05-Sep-2013 17:05:09 America/Denver] PHP Fatal error: Class 'Luracast\Restler\Restler' not found in /Users/ChrisLondon/personal/SuperfyMe/public/examples/_001_helloworld/index.php on line 19
It seems like it's trying to find the autoload class here: /Users/ChrisLondon/composer/autoload_classmap.php but the file is actually here: /Users/ChrisLondon/personal/SuperfyMe/vendor/composer/autoload_classmap.php
Solved my issue.
It turns out because I have a folder named composer/ that happens to be two folders up from where the Restler app sits it ruins the Restler autoloader. To solve the issue one needs to do one of the following:
1) Don't have any folder named composer/ two folders up from where the Restler app resides
2) Modify the Restler autoloader to skip the folder (at the time of this post you could comment out line 138 of /vendor/Luracast/Restler/Autoloader.php)
A more elegant solution has been proposed by me on GitHub:
Issue: https://github.com/Luracast/Restler/issues/195
Pull Request: https://github.com/Luracast/Restler/pull/196
By the time someone else finds this post hopefully the issue will be resolved in future versions of Restler.
all goes well suddenly i dont know why a fatal error occurred can any one please tell me the solution ???
Warning: include(lang.php) [function.include]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 59
Warning: include() [function.include]: Failed opening 'lang.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 59
Warning: include(lang2.php) [function.include]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 61
Warning: include() [function.include]: Failed opening 'lang2.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 61
Warning: include_once(inc.php) [function.include-once]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 265
Warning: include_once() [function.include]: Failed opening 'inc.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 265
Fatal error: Call to undefined function geoip_open() in /var/httpdocs/dev52/include.php on line 266
I would suggest you contact your webhost. If everything was working and it suddenly stops working, especially on a widely-used package like phpMyAdmin, it's more than likely someone changed a configuration setting and screwed it up.
If this doesn't help, or if you own the server yourself, try reinstalling phpMyAdmin.
This sometimes happens with nested includes, check to see if there are any include(); statements in lang.php and if so then include these files directly.