I've configured a couple of php codes that connects to my server with the use of ftp connect. It works perfectly when I'm testing it locally, it connects, it goes in, i can access stuff.
BUT
when I upload it online and try it there. The php code does nothing. It executes all lines before "ftp_connect" then from that line onwards, it doesn't get processed.
It doesn't show any errors, warnings, etc on screen but the code execution from the line of "ftp_connect" just stops.
What seems to be the problem?
Your host probably has error reporting turned off, try turning on error reporting with
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
at the top of your file, or check for a file called error_log in the directory of your script.
Related
I'm administering a system used by around 100 users. Everything is working fine except for one user. When that user logs in, the source will only output about 70 lines og html and then just stop executing. PHP show no errors whatsoever, and nothing is shown in the error log. Errors is enabled in the script.
If i remove some lines, in the html, it will execute more PHP, but then still stop at about 70 lines in the source code.
This, as I said, only happens for one user.
Does anyone have an idea about what could be going wrong here?
if error is not displaying it means the error display or error reporting is off in php.ini you can turn it on by the following php functions
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
?>
place above functions in the starting of your file and it will output error if any occurs.
I looked PHP.ini files but error mode is on there?
But when there is error in my code I cannot see php showing error??
I use local host called AMPPS.
And whenever there is error i see blank page like if i use:
require('something.php');
There is a blank page instead of showing fatal error or warnings.
I use CodeCanyon script. Can script change the error showing mode?
How can I display all there error even if it is small on as I am on development mode.
Can script change the error showing mode?
Yes, it can. For starters you can set this in your PHP file—before code like require('something.php');—to force errors to show:
error_reporting(E_ALL);
ini_set('display_errors', 1);
But that said, if errors are not displayed at all, check your Apache logs in your setup. Unclear on where in AMPPS the logs would be stored—or what your host system running AMPPS is—but there should be a log in there somewhere.
I'm trying to run a php script on my website through my file manager but it just shows a white blank screen. I ran a couple of test php scripts on my file manager and runs well. The php script that runs a blank screen has been tested offline with WAMP and works fine, The php script involves connecting to a database which it does, uses simple_html_dom for web scraping and inserting to a database. Can someone please help. Surely if it works offline it should work online no error messages are showing
Turn on your error reporting first :
error_reporting(E_ALL);
It might be occurring because you have switched off the error_reporting and the connection is not being successful.
Check if your database connection credentials are correct.
If the problem still exists, refer to this page :
PHP Blank Screen - Solutions
Make your error reporting on by
error_reporting(E_ALL);
Also, please check php's error log file.
Every page crash is printed there.
Generally, in php folders of WAMP, XAMPP.
For XAMPP in Windows, the file location is:
xampp\php\logs\php_error_log
I have a problem with PHP. There is an error that I have never encountered before. The home.php, which is the main page of my site, cannot be viewed. And there is nothing in error log. After there is an inclusion of a php page (a class that is a part of my API). Till that line the holl HTML (javascript and css inclusions) are echoed from php and successfully rendered in browser, but after the php kind of stops suddenly. When I delete that line(php page inclusion line), website works, but before, this inclusion didn't make any problem for me. I removed the code parts which after them I encountered this problem, but nothing works.
I am using Apache2, PHP5 with Ubuntu 11.10.
Any help will be appreciated, thanks in advance.
My first hints would be to check the following:
In your script set ini_set('display_errors', '1'); and error_reporting(E_ALL); to display all errors.
Turn on the php error log and check it for errors.
run php -l home.php on the command line to check your php file for syntax errors.
Check Apache's error log, sometimes error messages go there.
If nothing helps use a debbugger like XDebug to see where the script terminates, or alternative insert statements like die("here"); and move them around in your code, to see which parts of your scripts are passed.
Greetings and good luck.
I want to chceck files before I'll connect domain on my server. I've added them in direct admin, I've uploaded files - but I don't know how to get to them.
I have 4 domains connected, but i have acces only to one. I saw that it's possible to include file from higher level
include('../../panele-podlogowe.eu/adm/img/edit.gif')
That gave me correct image. But when I've done:
include('../../panele-podlogowe.eu/index.php');
Nothing happens (I've turned Error reporting on).
When I did something like:
include('../../panele-podlogowe.eu/index.php');
echo 'Failed?';
Nothing prints out... What the heck?
Solution:
ini_set("display_errors", "stdout");
Review the PHP error log. That usually, even under default settings, shows what's the problem.
Enable error reporting so php will print what is wrong. Add this at the top of your file.
error_reporting(E_ALL);
Otherwise:
Check the access permissions for that file
Double-check the file you are including for syntax errors. (if the include causes php to crash/segfault you might not get any output)