Jump to content

Recommended Posts

Posted

Trying to set up a php booking system via IIS/PHP/MySQL and hitting some issues.

 

The server has:

  • IIS 10 with Web Server/Application Development/CGI also enabled.
  • MySQL Essentials 5.0.41
  • PHP 7.1.9 Non-Thread Safe x64
  • Visual C++ Redistributable for Visual Studio 2015

 

Traversing the directory with a web browser, .html, .ico and .css files can all be opened , but .php files all return 'No input file specified.'

 

Things the internet told me to try:

  • Commenting out doc_root in php.ini [No effect.]
  • Commenting out open_basedir in php.ini [Broke it, .php files returned Error 500. Reverted to %SystemDrive$\inetpub\Booked]
  • setting .php MIME type 'text/html' [No effect.]
  • Setting FastCGI Request Restrictions Mapping to 'File or Folder' [No effect.]
  • %windir%\system32\inetsrv> cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe" [Failed. File doesn't exist (Input Error: Can not find script file "C:\Windows\System32\inetsrv\fcgiconfig.js")]
  • Setting cgi.fix_pathinfo = 1 in php.ini [Already set to 1]
  • Granting 'Everyone' and 'Authenticated Users' Read & execute/List folder contents/Read permissions on C:\inetpub\ and all nested files/folders. [No effect.]

 

Stuck for ideas and not finding any other potential solutions now.

Someone with more knowledge than me got any ideas?

Posted (edited)

Oh ignore that first bit just re-read and noticed you said you did in a bit :p

 

In your php ini did you enable all the windows php extensions? Can't remember if the default installer enabled them or whether you had to manually as sometimes they're commented out.

 

This sort of bit:

 

extension_dir="C:\Program Files (x86)\PHP\v5.4\ext" (Might be different path if you're using 64bit ones)

 

[ExtensionList]

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_mbstring.dll

extension=php_gd2.dll

extension=php_gettext.dll

extension=php_curl.dll

extension=php_exif.dll

extension=php_xmlrpc.dll

extension=php_openssl.dll

extension=php_soap.dll

extension=php_pdo_mysql.dll

extension=php_pdo_sqlite.dll

extension=php_imap.dll

extension=php_tidy.dll

 

 

Steve

Edited by Steve21
  • Thanks 1
Posted
Under your IIS site settings, and handler mappings. I'm assuming you have a .php handler showing? if so edit it and what's the request restrictions set to?

Indeed.

 

Request Path: *.php

Module: FastCgiModule

Executable (optional): C:\PHP\php-cgi.exe

Name: FastCGI

 

Request Restrictions:

Mapping: [Checked] Invoke handler only if request is mapped to: File or folder

Verbs: Specify the verbs to to be handled: All Verbs

Access: Specify the access required by the handler: Script

Posted
In your php ini did you enable all the windows php extensions? Can't remember if the default installer enabled them or whether you had to manually as sometimes they're commented out.

All of them? No. Just the one that Microsoft told me to, extension=php_mysql.dll (which I've just noticed is actually ;extension=php_mysqli.dll in my php.ini, for some reason....?)

 

Should I de-comment any of the others?

 

;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_ftp.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

Posted

Sorry yeah misread your top post :p editted it above with another question, but also I assume when you're testing a php file you're using it below the value you set as the root?

 

Commenting out open_basedir in php.ini [broke it, .php files returned Error 500. Reverted to %SystemDrive$\inetpub\Booked]

 

If you set it as booked it wouldn't process anything above that, so if your test php file was inside wwwroot etc it'd just go nope!

 

Error 500 is a fatal error in your php file, so sounds like it was working when you removed the base, but you have a problem :p If you modify the php.ini line -

ini_set('display_errors', 1); 

and re-comment out your base dir what does it say?

 

Steve

  • Thanks 1
Posted
All of them? No. Just the one that Microsoft told me to, extension=php_mysql.dll (which I've just noticed is actually ;extension=php_mysqli.dll in my php.ini, for some reason....?)

 

 

Sorry keep double posting over ya :D The MS example is just saying decomment what you need, not specifically to just decomment mysql :p It depends if its looking for something else, but if all you're doing is testing a standard php page shouldn't need many done.

 

In terms of the dll there's both:

 

extension=php_mysql.dll
extension=php_mysqli.dllp

 

Would suggest to try changing the open_base first and enabling the error log so you get a real error (500s arent useful :p)

 

Steve

  • Thanks 1
Posted
Sorry yeah misread your top post :p editted it above with another question, but also I assume when you're testing a php file you're using it below the value you set as the root?

Commenting out open_basedir in php.ini [broke it, .php files returned Error 500. Reverted to %SystemDrive$\inetpub\Booked]

If you set it as booked it wouldn't process anything above that, so if your test php file was inside wwwroot etc it'd just go nope!

Yes, open_basedir = %SystemDrive$\inetpub\Booked

Everything to do with this booking system exists in inetpub\Booked or a subfolder of it (or a subfolder of a subfolder.. you get it.)

 

Error 500 is a fatal error in your php file, so sounds like it was working when you removed the base, but you have a problem :p If you modify the php.ini line -
ini_set('display_errors', 1); 

and re-comment out your base dir what does it say?

 

AHA!

 

display_errors = On and open_basedir commented out gets me:

Fatal error: Uncaught --> Smarty: unable to write file C:\inetpub\Booked\tpl_c\wrt59c286abc5a394_34023484 <-- thrown in C:\inetpub\Booked\lib\external\Smarty\sysplugins\smarty_internal_runtime_writefile.php on line 49

 

Giving Authenticated Users 'Modify' permissions and viola!

Capture.PNG

 

Not an error! Woo!

Should probably disable directory traversal if I have to put a password in a file, though..

 

Fantastic! Hopefully I shouldn't have any more issues. Thank you!

Posted

Woot :p

 

Normally with php password/configs there's option to set the auth back after it's installed, so might be worth a try as shouldn't need to be left as modify rights etc unless there's another issue with permissions somewhere :D

 

Steve

Posted

Aye, hopefully it just needs Modify whilst it sets itself up. My hope is that after everything is configured, I can drop it down to Read-only since the rest ought to just be modifying a SQL database done with credentials I provide the software.

 

Anyway. Going home now. That's a job for tomorrow.

Thanks again!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...