My PHP code is not running on XAMPP

  • updated
  • Answered
i'm using xamppv3. i stored my php form in the htdocs folder. when i run my script to connect to my database, it doesn't connect but rather displays the php code. can someone pls help me with this?

Hello and thanks for contacting us. I recommend checking your server logs and code validators for PHP and MySQL.

Hello timecraft,

Thank you for your question on php in xampp. Unfortunately we do not provide custom code solutions. If you are receiving an error message and have a question about that, we can certainly assist with that.

Kindest Regards,
Scott M


While I am not very familiar with XAMPP, it does sound like your code is not appropriately being handled by Apache as PHP. You would need to ensure that PHP is properly running on your system. Be sure that all PHP also files also have a .php extension on them. You may test your PHP configuration by creating a phpinfo page that will allow you to see your PHP settings as well.