I am writing a web page that uses some php files. The php isn't working properly and I am trying to debug for things such as printing variables. I am new to php so this is all new territory.
I use firebug for other debugging and css alignment so I thought firephp might be a good way to begin.
I added firePHP into firefox and then following some tutorials I found I added this to my php file:
<?PHP
/* comment here down to line 15 */
require_once('FirePHPCore/FirePHP.class.PHP');
$firephp = FirePHP::getInstance(true);
The result I get when I load my page is:
Warning: require_once(FirePHPCore/FirePHP.class.PHP): failed to open stream: No such file or directory in /var/www/contactform.php on line 15 Fatal error: require_once(): Failed opening required 'FirePHPCore/FirePHP.class.PHP' (include_path='.:/usr/share/php') in /var/www/contactform.php on line 15
It seems like some more setup and library loading is required, but I am not sure what or how?
I am developing on Ubuntu using apache and /var/www/ as my local server.
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
Advice on how to get past this error?
You need to add the "FirePHPCore" folder to the same directory that this code is being run in
require_once('FirePHPCore/FirePHP.class.php');
The file extension (.php) is NOT SUPPOSED TO BE CAPITALIZED.
Related
I have recently been trying to add PHPMailer script to my site, following the accepted answer from here:
Send attachments with PHP Mail()?
I have never used a require statment before so I assume I must be doing it wrong, currently testing on my local host version of the site. I have downloaded the entire zip of git (unzipped it) and moved it to the dir my scripts are in.
In my script I added the following line:
require_once(__DIR__.'/PHPMailer-master/class.phpmailer.php');
Which to my understanding was all I needed to do to use it. However I get this error:
Warning:
require_once(C:\xampp\htdocs\Website\PHPMailer-master\class.phpmailer.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\Website\include\mailer.php on line 10
Fatal error: require_once(): Failed opening required
'C:\xampp\htdocs\Website\PHPMailer-master\class.phpmailer.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\Website\include\mailer.php on line 10
Any ideas what is causing this error? Am running PHP 5.6.21 if this is relevant.
Try to use the full path to the file, using realpath() - http://php.net/realpath, and use dirname(__FILE__) to get your current directory:
Recently, I formated my whole computer, and installed Windows 7 64-bit. Before doing that I saved all of my files on an external hard drive. One of the things I backed up was a PHP script which uses AWS DynamoDB Services.
Before I formated my computer, everything went perfect. After I formated it, I installed on it XAMPP, Visual Studio Code, and PHP 7.1.1 through Microsoft WebPI.
Currently when I'm trying to run my PHP script I get this error on my screen:
Warning: require(/zip/aws/aws-autoloader.php): failed to open stream: No such file or directory in D:\Users\Lenovo\xampp\htdocs\public_html\file.php on line 7
Fatal error: require(): Failed opening required '/zip/aws/aws-autoloader.php'(include_path='D:\Users\Lenovo\xampp\php\PEAR') in D:\Users\Lenovo\xampp\public_html\file.php on line 7
I'm calling the autoloader this way:
require '/zip/aws/aws-autoloader.php';
I'm trying to understand if I forgot to install another thing, or if it's something related to the system (I had Windows 10 before)...
Could you please help me figure it out? I'm pretty new to this topic of PHP...
You should specify the entire path, like this: require __DIR__ . '/zip/aws/aws-autoloader.php';
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.
I moved wordpress from one server to other...home page is running fine but when I click to category pages/links it shows these errors
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/server/public_html/index.php on line 17
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/server/public_html/index.php on line 17
Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/server/public_html/index.php on line 17
I searched on google and tried accordingly but not solved. I tried wp-codex tech like http://codex.wordpress.org/Changing_The_Site_URL but also failed. I have the wp-blog-header file in my directory but still not working....any help ...thanx in advance
Change php version for 7. My tech.support make this and problem was done
I had a similar issue and the problem was with the PHP version used which in my case by default was PHP 5.2 and it was throwing the 500 status code error.
When upgrading the PHP version to 5.3 the 500 status code was gone but Wordpress returned this error:
Your server is running PHP version 5.3.29 but WordPress 5.4.2 requires at least 5.6.20.
Note to myself (and everyone else with this error): When moving Wordpress websites between different servers make sure you are running the minimum required PHP version.
Also remember:
Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.6.20+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.
According to WP docs the recommended PHP is version 7.3.
Try the default theme and see if you still have the error. If so the theme you are using is causing the error - as in my case. The page that had an error was calling a file in "pages" that was not there. When I changed what is to show on that page to something current - the error went
I am having the same problem on the Windows-with-xampp side of the fence as Gerardo Tarragona is having on the Ubuntu-with-lampp side. Ref: How to install phpChart lite library?
I have tried a couple or few things and the roadblock I am hitting (see PHP error messages from browser below the code snippet) seems to be that the conf.php file is trying to require_once('phpChart.php') but I cannot find this file phpChart.php anywhere on disk. It does not seem to be with the phpChart_Lite extracted download. Can anybody shed light on this ? What am I missing ?
Here is the conf.php file code:
<?php
define('SCRIPTPATH','/phpChart_Lite/');
define('DEBUG', true);
/******** DO NOT MODIFY ***********/
require_once('phpChart.php');
/**********************************/
?>
Warning: require_once(phpChart.php): failed to open stream: No such file or directory in C:\xampp\htdocs\phpChart_Lite\conf.php on line 10
Fatal error: require_once(): Failed opening required 'phpChart.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\phpChart_Lite\conf.php on line 10
Depending on your system, change SCRIPTPATH to
define('SCRIPTPATH','/phpChart_Lite');
or
define('SCRIPTPATH','phpChart_Lite/');