PHP Scripts Won't run - Win10

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
abrogard
New php-forum User
New php-forum User
Posts: 22
Joined: Sat Oct 14, 2006 2:25 am

Thu Feb 16, 2017 1:41 pm

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?

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 696
Joined: Mon Feb 22, 2016 5:52 pm

Thu Feb 16, 2017 2:31 pm

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.

abrogard
New php-forum User
New php-forum User
Posts: 22
Joined: Sat Oct 14, 2006 2:25 am

Thu Feb 16, 2017 2:58 pm

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.

:)

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 696
Joined: Mon Feb 22, 2016 5:52 pm

Fri Feb 17, 2017 11:20 am

Yes, I use Ubuntu.

Have you got your script working now?

abrogard
New php-forum User
New php-forum User
Posts: 22
Joined: Sat Oct 14, 2006 2:25 am

Fri Feb 17, 2017 3:54 pm

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...

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Sat Feb 18, 2017 7:41 am

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.

abrogard
New php-forum User
New php-forum User
Posts: 22
Joined: Sat Oct 14, 2006 2:25 am

Sat Feb 18, 2017 11:14 am

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?

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Sat Feb 18, 2017 12:53 pm

Haven't tried it myself (don't usually develop under Windows) but have a read of http://php.net/manual/pl/install.window ... ndline.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).

Post Reply