Double-Click PHP File On Desktop
Posted by: Popowapco (---.243.popsite.net)
Date: April 16, 2010 11:45AM

I have a PHP file on my desktop. I know this is not possible with Wampserver "out of the box", but is there some sort of hack that would allow me to open that file via Wampserver by simply double-clicking the file's icon?

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: April 16, 2010 04:29PM

its not wamps fault..
thats the way it is..
you have to run the file through the browser for the php to work

you could always place a shortcut on your desktop for the browser... like

iexplore [localhost]

but the file must be in the www folder for it to work

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: mikejones (---.dynamic.dsl.as9105.com)
Date: April 16, 2010 05:42PM

Popowapco,

If I understand you correctly you want to be able to execute a php script outside of your browser.

PHP comes in two variants, the CGI version for web pages and the command line interface (CLI) that you can use to run scripts from the cmd prompt or a batch file. The command line version is normally called php.exe and found in \wamp\bin\php\php[version] directory.

There are some examples of its use and plenty more information on the php.net site.

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: Popowapco (---.243.popsite.net)
Date: April 17, 2010 06:10AM

Perhaps my original post was not quite clear enough. So I will try to make it more clear in this post.

I have a PHP file named Test.php on my desktop. Here is the entire code that is in Test.php:

<?php
echo "Hello ";
echo "World";
?>

I want to simply double-click Test.php on the desktop, and thereby cause the following to appear in my browser:

Hello World

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: mikejones (---.dynamic.dsl.as9105.com)
Date: April 17, 2010 09:40AM

I have obviously misunderstood.

You will find double clicking a simple html file more suited to displaying hello world in a browser.

I mistakenly thought you had some sort of application in mind.

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: April 17, 2010 10:40AM

you cant do this..

make an internet explorer shortcut on your desktop...

right click it > properties

in the target box

add htt p://localhost/file.php to the end

so it will be like TARGET: iexplore.exe ht tp://localhost/filename.php

and put the php file in the www folder

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: yfastud (Moderator)
Date: April 17, 2010 03:54PM

php is server script which must be run through localhost so apache can parse php to run, not like html which is client script which you dont need to run under a webserver and thus you can run a html file anywhere, but not php file

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: vairam (---.65.165.122.airtelbroadband.in)
Date: April 01, 2013 07:19AM

I tried to run php file from desktop. But it fails. IS there any procedure to run php file from desktop.

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: stevenmartin99 (Moderator)
Date: April 01, 2013 09:36AM

Get a php book . Seriously

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: sm8082 (---.zone5.bethere.co.uk)
Date: May 28, 2014 11:37AM

Do this:
create a html file on the desktop and put the following code in it:
<META HTTP-EQUIV="refresh" CONTENT="1; URL=http://localhost/your_site_folder/or_file">
save it as file_name.html
close it and double click it. It will open up your website from the wamp folder

Options: ReplyQuote
Re: Double-Click PHP File On Desktop
Posted by: RiggsFolly (---.as13285.net)
Date: May 28, 2014 12:00PM

Hi sm8082,

This is very clever, but not a sensible solution especially for beginners.

Never attempt to run a html or php page by double clicking on it from explorer Always use the browser address bar.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.