Downloading PHP | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Downloading PHP

When I try opening my created PHP file..it loads on the browser and attempts to download the same php file...even after I click on download..if I open it..it attempts to download the same file....even when the action of the form on my HTML file is directed to the php file..it still attempts to download the file... Any solution please...

14th Jun 2017, 9:48 AM
Dillion
Dillion - avatar
9 Answers
0
Open localhost:8000/your-file.php
14th Jun 2017, 11:51 AM
Calviղ
Calviղ - avatar
+ 2
when I open localhost:8000 and I run the php file...it will execute?
14th Jun 2017, 10:47 AM
Dillion
Dillion - avatar
+ 1
You will need a localhost. You can download a server either ampps or xampps or wamps. Just search online on how to install it. After complete installation. Move your php code to the server directory. The directory for wamps is www. Then enter localhost to the browser. You will see your script then click on it. It will show your script otherwise it won't show. Google search for more information.
14th Jun 2017, 10:25 AM
Salami Haruna
Salami Haruna - avatar
0
You can't download PHP files, it's protected by web servers.
14th Jun 2017, 9:54 AM
Calviղ
Calviղ - avatar
0
But it keeps requesting download when I open it
14th Jun 2017, 9:57 AM
Dillion
Dillion - avatar
0
You can't download PHP files. You can only request web server to parse PHP and response with HTML.
14th Jun 2017, 10:00 AM
Calviղ
Calviղ - avatar
0
i already have Xampp.... How do I move my php code to its directory?
14th Jun 2017, 10:28 AM
Dillion
Dillion - avatar
0
For XAMPP, you can run PHP from any folder. Just open command line issue command: "c:\xampp\php.exe -S localhost:8000" and then open "localhost:8000" from any browser.
14th Jun 2017, 10:37 AM
Calviղ
Calviղ - avatar
0
It happens all the time try rapidphp editor and everything will be fine
30th Oct 2020, 10:39 AM
Cleen
Cleen - avatar