Maurice Rodriguez Maurice Rodriguez - 4 months ago 19
PHP Question

Unable to connect to local host when running PHP

I am trying to learn PHP and use Netbeans as my IDE along with a PHP plug-in, but the problem is that when I run the script, my browser (Firefox) couldn't connect to localhost.

My code is a simple query to my current PHP information.

<?php
phpinfo();
?>


This is the address I'm trying to access:

http://localhost/PhpProject1/index.php

Answer

Create a folder PhpProject1 in xampp/htdoc folder. Suppose you have installed xampp at c drive root then folder structure will be c:/xampp/htdoc/PhpProject1/ and place index.php it it, after that you may add any php code i.e

<?php
  phpinfo();
?>

Hopefully this is the answer of your question. Takecare