PHP Scripts Won't run - Win10

A

Anonymous

Guest
win10 64 bit.

I've been hassling installing IIS and PHP and got a win today. I can now go to my localhost page and run phpadmin.

So that's php talking to sql and a php script is running, right?

but when in windows explorer I click on a .php script the system doesn't know what to do with it.

it should run automatically, surely?

I want to install piwigo and their install script is a .php file.

Is this simply a matter of file associations or is my php installation not correct after all?

Can anyone help?
 
There will be a directory where you should put any php script that you want to run, outside of this folder will not be executed by your server software, this should have been noted during installation.

There may be a directory by the name of html, htdocs or www on your system, sorry, I don't use windoesn't so I can't help much more than that other than go back through the instructions you followed to install it and find out where you are supposed to store the php files.
 
Thanks for that.

What do you use - Linux of some brand I guess? I might well follow you there..

I'm surprised. But okay, if that's it.

:)
 
Yes, I use Ubuntu.

Have you got your script working now?
 
Yes, I put piwigo into the inetpub/wwwroot dir - into a new directory I made for it called 'piwigo' - and it ran fine only it made a directory for itself also called 'piwigo' . You get that. :)

Why won't they run from any directory at all? Because they're only run by server software I suppose. And the system can't or won't associate the file extension with that software...
 
The php scripts are usually run by a process which is listening to a network port. So rather than like Word which is automatically run when you click on a document, php tends to be sent as a request by a web browser.
This process is configured to only access scripts etc. from specific directories - this helps with security as it means you can limit access to anything on the machine running your server.
 
Yep. Thanks for that. There's no way to configure so's a script can be clicked on in windows explorer anywhere on your machine and it will run?
 
Haven't tried it myself (don't usually develop under Windows) but have a read of http://php.net/manual/pl/install.windows.commandline.php. You can run any PHP script from the command line, but the output will also go to the command file and so be lost (bit like running any batch file).
 
Back
Top