PHP Error


 

I am wondering why my http://localhost/ server is not displaying any error? I am throwing errors like “require(test.php);” which doesn’t exists,

Tried throwing every error, but either screen goes blank or the actual output comes, but no error is reported.

If the page only shows the code that’s because the PHP interpreter isn’t running. Look at your httpd.conf (Apache configuration file) and look if the line that says ‘LoadModule php5_module’ isn’t commented with # sign.

Image Also, look for ‘Listen’ should say ‘Listen 80’ so you can put simply http://localhost/ on the browser. If the server is running on another port instance e.g. the line shows ‘Listen 8080’, put on the browser http://localhost:8080/. This is a more uncommon issue.

If that doesn’t make any change, maybe the PHP module isn’t installed. I suggest to use a pre-configured package software with Apache/PHP/MySQL like xampp or mamp.

Make a new file on the root folder of your web server, ‘test.php’. Add on the content:

  1. <?php
  2. echo phpinfo();
  3. ?>

Then on the browser access to http://localhost/test.php
It should display the PHP version and installed modules.

Well this is to manage sort of troubles with PHP, I haven’t seen the previous page and the year.

You should look to your php.ini if the “display_errors” is set to “1” or you can set the variable over php with:

ini_set('display_errors', 1);

I also wrote error_reporting(E_ALL); on top of the file, but still, can’t figure out.

Concerning the files, you need to put your files in a folder called “htdocs” where you installed the apache webserver
for example my files are in c:/program files/apache group/apache2/htdocs/folder name/
so I on my browser I type
http://localhost/foldername/filename

but first check if the server is running.

You might have hard-coded references to include files. You should use $_SERVER['DOCUMENT_ROOT'] instead of hard-coding filepaths because on a local windows PC your path will be something like C:/path/to/my/webroot whereas, for example, on a Linux shared-hosting production server your path will be something like /home/user_name/public_html/.

<a href=”itechonology.com”>php development company in india</a>,<a href=”itechonology.com”> wordpress development company in india</a>,<a href=”itechonology.com”> seo company in india</a>

Advertisements

2 thoughts on “PHP Error

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s