hiiii....
i am just started php...The problem is that the web page blank when an syntax error occurs in code ,,,so i am getting difficulties to locate the problem...how can i know wher is the problem..?
can any one please help me........!

Dani AI

Generated

Blank pages on a PHP page almost always mean PHP errors are being hidden. Parse (syntax) errors are reported at compile time — before your script runs — so turning error reporting on from inside the same script often won’t reveal them. Start by linting the file from the command line to get the exact error and line number:

php -l /path/to/yourfile.php

If you need errors shown in the browser while developing, enable them in PHP’s configuration and restart the web server. Typical php.ini settings:

display_startup_errors = On
display_errors = On
error_reporting = E_ALL
log_errors = On

If you cannot edit php.ini, create a tiny phpinfo() page to find which ini file is in use, or — when PHP is run as an Apache module — enable display via .htaccess (mod_php only). Note: ini_set() inside the failing file will not show parse errors because the file never executes.

Also check the server error log (for example /var/log/apache2/error.log or your host’s control panel logs) — many errors are written there even when the browser is blank. Use an editor or IDE with PHP linting or enable Xdebug for better diagnostics. Be careful never to leave display_errors = On on a public production site; use log_errors and a secure error_log path instead.

For quick verification and authoritative details see the PHP manual on error configuration and the CLI options for linting: PHP error handling and configuration and PHP command line usage.

This follows up on ’s suppression tip and the reference shared by while addressing the parse-error specifics you reported, .

Recommended Answers

All 3 Replies

could you please post your code?

tip:if you want to see error in your code,remove @ sign in your script if you have used them.

@ is used to prefix function names to trap errors like: @mysql_connect("blah,blah");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.