Jump to content

PHP Pages come up as exe files


Edtheredhead

Recommended Posts

Hi!  I'm new to this board & new to programming in PHP.

 

I've recently downloaded XAMPP so that I could learn PHP/MySQL, etc. and according to the XAMPP info, everything is installed correctly.

 

However, when I create a php file (even a very, very simple one), it comes up as an executable file, almost as if it's unzipping.  It always gives me an option of Save or Run.  I click on Run, than then it comes up again.

 

Any ideas of what I've done wrong?  I'd really appreciate your help!

 

Thanks!

 

Ed

Link to comment
https://forums.phpfreaks.com/topic/162258-php-pages-come-up-as-exe-files/
Share on other sites

Hi

 

It could be that the PHP file is not running through the webserver, and is instead being opened directly from your HDD.

 

you need to access PHP files through the local web server, usually something like 'http://localhost/myfile.php' instead of opening the file direct from explorer.

Your server software (Apache?) is most likely misconfigured.

 

 

Somewhere you should have:

 

 

LoadModule php5_module "x:/your/path/to/php/php5apache2_2.dll"

 

And

 

AddType application/x-httpd-php .php

 

 

Then, unless you plan to put your php.ini somewhere in your PATH environmental variable (I add PHP's directory to my PATH, but I don't know if you'll do that or not), you'll need to add:

 

PHPIniDir "/path/to/php/folder/"

Your server software (Apache?) is most likely misconfigured.

 

 

Somewhere you should have:

 

 

LoadModule php5_module "x:/your/path/to/php/php5apache2_2.dll"

 

And

 

AddType application/x-httpd-php .php

 

 

Then, unless you plan to put your php.ini somewhere in your PATH environmental variable (I add PHP's directory to my PATH, but I don't know if you'll do that or not), you'll need to add:

 

PHPIniDir "/path/to/php/folder/"

 

Okay, not to sound stupid, but I am not a hardware type of guy, where & how do I make these changes?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.