I am using Codeigniter as my PHP framework. When I run the factual API I get results but there are PHP warnings.
Severity: Warning
Message: include(/home/bwilson/public_html/factual/CI_DB.php): failed to open stream: No such file or directory
Filename: factual/Factual.php
Line Number: 217
Severity: Warning
Message: include(): Failed opening '/home/bwilson/public_html/factual/CI_DB.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')
Filename: factual/Factual.php
Line Number: 217
I a look at line 217 in the factual.php file and it reads:
include dirname(__FILE__)."/".$className . ".php";
What is the referring to? I have tested this without running the Factual API and the controllers load find. It is only when I start using the Factual API.
This is the reply I received from Factual:
The driver employs an SPL Autoload function to include files for
unloaded classes dynamically.
Here, the class CI_DB -- a Codeigniter class, not Factual -- is being
called without being loaded first. This triggers our autoload feature
in a final attempt to load the file.
In short: this is not a Factual driver issue; to solve, ensure the
file containing the CI_DB class is loaded properly.
It's just trying to find CI_DB.php in the same folder as factual.php.
Make sure that file actually exists where it's trying to find it. Pay attention to what case the filename is.
If the file does indeed exist where its supposed to, check its permissions.
After looking for into the error returns unsupported modules. I just disabled the error reporting in the index.php file by setting error reporting to production. In the mean time I am okay with it as long as my results are the same.
Thank you everyone that contributed.
Do you use?:
require_once BASEPATH . "/{$className}.php";
Related
someone could tell me if there is a reason why I get these PHP errors, which should not exist.
PHP Warning: include (xyz.php): failed to open stream: No such file or directory in /mypath/myfile.php on line 351
When the file clearly exists!
PHP Fatal error: Can not access MyClass::$myproperty in /mypath/MyClass.php on line 250
When the declaration exists:
class MyClass
{
...
public static $myproperty = array();
...
I would like to emphasize that these errors are not always reported! But only once in a while. When I make a mistake writing a part of the code, the PHP fatal error should always occur, not 5 times a day from 12:22 to 12:27 and nevermore. I'm talking about a site from thousands of visits a day, I'm also talking about a .php file that is included on a regular basis in every request of any page.
I can't get any error in my pc (php 5.6 also) when I run and test the web application.
Is it possible some server problem?
Thanks.
I've updated my mediawiki from 1.26.2 to 1.27, the installation process finished ok, but when I try to access I received this error:
Warning:
require(/var/app/current/includes/specials/SpecialUserLogin.php):
failed to open stream: No such file or directory in
/var/app/current/includes/AutoLoader.php on line 81 Fatal error:
require(): Failed opening required
'/var/app/current/includes/specials/SpecialUserLogin.php'
(include_path='/var/app/current/vendor/pear/pear_exception:/var/app/current/vendor/pear/console_getopt:/var/app/current/vendor/pear/pear-core-minimal/src:/var/app/current/vendor/pear/mail_mime:/var/app/current/vendor/pear/mail_mime-decode:/var/app/current/vendor/pear/net_socket:/var/app/current/vendor/pear/net_smtp:/var/app/current/vendor/pear/mail:.:/usr/share/pear:/usr/share/php')
in /var/app/current/includes/AutoLoader.php on line 81
I have no idea why is this happening. If I check the files in my server they're there. I'm also having template issues if I choose vector I only get a messed up template, without styling.
I'm using PHP 5.6.
I hope someone can help me.
I just stumbled across this same exact error after upgrading to MW 1.27.
In my case, the SpecialUserlogin.php existed and all of the permissions were right BUT the word login was written in lowercase so the system thought this file didn't exist. So I just renamed the SpecialUserlogin.php to SpecialUserLogin.php and b00m, it worked!
As for your templating issues, check the common.css file. Copy paste everything out of there, so it's empty, if you don't use it. And check that you're calling your style files correctly in your template.
When I try to execute any controller of my CodeIgniter project i receive this error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered
Severity: Error
Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)
Filename: drivers/Session_files_driver.php
Line Number: 49
Backtrace:
I tried to replace CodeIgniter system files but it didn't work. The problem appears in all projects
Problem solved by restarting Apache.
I attach the url which saved me: http://forum.codeigniter.com/thread-64763.html
In my case i did the following
Restart apache
That's it!
The files in system should not be modified. My files were modified somehow and were throwing error. I resolved my problem as below.
Download fresh codeigniter and extract files
copy system files from fresh codeigniter into your project and overwrite the whole system folder.
This should fix your problem.
I'm sticking a web interface which I've been given (that works on other systems) onto a switch, which happens to be in php/soap.
I get this error
Warning: require(/class_main.php) [function.require]: failed to open stream: No such file or directory in /jffs2/usbflash0/ran/www/includes/config.php on line 4
Fatal error: require() [function.require]: Failed opening required '/class_main.php' (include_path='.:') in /jffs2/usbflash0/ran/www/includes/config.php on line 4
config.php:
<?php^M
require($_SERVER['DOCUMENT_ROOT'].'/includes/errors.php');^M
require($_SERVER['DOCUMENT_ROOT'].'/includes/library.php');^M
require(get_structures_directory().'/class_main.php'); ^M
error_log(get_structures_directory());
require(get_structures_directory().'/class_softcore.php');^M
require($_SERVER['DOCUMENT_ROOT'].'/includes/format.php');^M
?>^M
Which looks for class_main.php in here:
1.0.1/ 1.0.3/ 2.0.5/ 2.0.7/ 3.0.10/ 3.0.12/ 3.0.3/ 3.0.5/ 3.0.7/ 3.0.9/
1.0.2/ 1.0.4/ 2.0.6/ 3.0.1/ 3.0.11/ 3.0.2/ 3.0.4/ 3.0.6/ 3.0.8/
Now class_main.php is in some of these version folders and not in some of them. What is the issue here? is it trying to use one of the folders where it is not located?
Well First class_main.php must be in all the folders, So application will not fail for any instance. If it is unlikely you can check for version and require only in that cases like
switch($version)
{
case "1":
case "2":
require($file_path);
break;
}
You can also use include instead of require which will give you warnings instead of error, However it is unadvisable specially on pure php libraries, As it will gave application undefined behaviour.
I'm using Doctrine 1.2.
The code is trying to include some entities (in the example, AdvertiserUsers) by adding the suffix "Table" at the end. I print a trace at the end of this message.
The thing is, my app does not use these files! I have my models called AdvertiserUsers on the style, with no need for an AdvertiserUsersTable file. Actually, I have my models called "AdvertiserUsers" only, and my app works OK without it (ugly warnings aside - which I want to get rid of).
I don't know why it tries to include these files that are not needed. This is the actual issue.
As a side note, my application has been doing this after I integrated an external module (from a freelance) that used a direct connection - no Doctrine - and happens on this module, when having to integrate both and using separate connections for different data.
Trace:
[26-Jul-2011 22:59:06] PHP Warning: include_once(AdvertiserUsersTable.php): failed to open stream: No such file or directory in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php on line 146
[26-Jul-2011 22:59:06] PHP Warning: include_once(): Failed opening 'AdvertiserUsersTable.php' for inclusion (include_path='/usr/local/zend/apache2/htdocs/stats-from-zero/application/../library:/usr/local/zend/apache2/htdocs/stats-from-zero/library:/usr/local/zend/apache2/htdocs/stats-from-zero/library/doctrine::/usr/local/zend/apache2/htdocs/stats-from-zero/library/recaptcha-php-1.10:/usr/local/zend/apache2/htdocs/stats-from-zero/public/php-form-builder-class:.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/usr/local/zend/apache2/htdocs/stats-from-zero/application/modules/stats/models:/usr/local/zend/apache2/htdocs/stats-from-zero/application/modules/stats/forms') in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php on line 146
AdvertiserUsersTable.php does not exist. Check name of that file & specific directory. It should be there