Link to home
Start Free TrialLog in
Avatar of pepps11976
pepps11976

asked on

PHP Help Please

Hi all i have posted a similar question but i am now getting a different error so i thought i would start a new question.

Trying to get .php working on my iis 6 windows server and cannot get this working, i have followed various guides which all seem to contradict each other about versions etc.

I have installed Fast CGI and downloaded the zip file for php version 5.3.17 Thread safe

i have created a phpinfo.php file and put it on my site which has this inside

<?php phpinfo(); ?>

but when i browse to it i get the following error

The page cannot be displayed
 You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
--------------------------------------------------------------------------------

Please try the following:
 •Contact the Web site administrator if you believe this directory should allow execute access.
 
HTTP Error 403.1 - Forbidden: Execute access is denied.
Internet Information Services (IIS)
 
--------------------------------------------------------------------------------

Technical Information (for support personnel)
 •Go to Microsoft Product Support Services and perform a title search for the words HTTP and 403.
 •Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Configuring ISAPI Extensions, Configuring CGI Applications, Securing Your Site with Web Site Permissions, and About Custom Error Messages.
 •In the IIS Software Development Kit (SDK) or at the MSDN Online Library, search for topics titled Developing ISAPI Extensions, ISAPI and CGI, and Debugging ISAPI Extensions and Filters.


i really need help on this as i cannot install our new website and this has been going on for 3 days now.

Please please can someone help me
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

In IIS6, look up the website properties (Right click -> choose properties) and set Home Directory -> Execute Permissions to Scripts Only or higher
Avatar of pepps11976
pepps11976

ASKER

It is set to scripts and executables i have also tried scripts only still the same
OK, next step is to look at the permissions for the folder in Windows. So, in Windows explorer, right click the home directory for the site and check permissions there. Does the IUSR_<machinename> user have read & execute permissions on that folder?
Ok the site folder did not have IUSR permissions but now it has the following

Read and execute
List Folder Contents
Read

Still the same error though
Avatar of Loganathan Natarajan
the permissions are set to the above
Is the folder located in Inetpub\wwwroot? Or somewhere else?
its located somewhere else
It is the folder located in Inetpub\wwwroot
Is it located on a physical disk on that machine or a remote disk? It could be that permissions you are setting locally arent being picked up by the host server hence the errors. I had a similar issue in the past (Althoug on IIS7)
its on a physical disk on the machine, i think it has something to do with the php setup, i must of read 50 articles trying to get this working all articles telling you to do different things.. Crazy....

John
It could be worth creating a folder in wwwroot folder. In that copy your simple phpInfo script. CHange the home directory to your new folder and see if the same issue happens. If it does, its an IIS config issue
Yes just done that produced the same error
OK, have you enabled fastcgi.impersonate in PHP.ini?

It may be worth going through the whole install procedure again. This time, download the non-thread safe version (its recommended by PHP for IIS).

Follow the steps in this and it may get you sorted.

http://php.net/manual/en/install.windows.iis6.php
ok i will try and do this again

ill post back in a bit
Also, just as a side, find where your php.ini file is, and make a copy of it, calling it php-cgi-fcgi.ini. Restart IIS and try again.
ok done that something different now when i browse to phpinfo.php i get this

PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\Websites\ftproot\localuser\john.pepper\www\DDA\phpinfo.php on line 1
OK, thats good, thats a PHP warning (Not an error) not an IIS one, which means your PHP is being interpreted now. Is it outputting the phpinfo(); text?
To solve that issue with timezone, just set the timezone in php.ini to whatever you need
ok can you give me an example sorry im new to this can you guide me :)
Whats your Timezone? Are you UK or US or somewhere else?
As an example, my own entry in php.ini would would look like

date.timezone = "Europe/London"
ok something strange going on now i have not done anthing yet just went to check all was ok again and now when i browse to phpinfo.php i get



The website cannot display the page
 


 HTTP 500
 


 


Most likely causes:
•The website is under maintenance.
•The website has a programming error.
 


 


What you can try:
 


 







Refresh the page.

 


 







Go back to the previous page.

 
John
Can you post the exact code in your php page?
<?php phpinfo(); ?>
Can you replace it with this, just to see if its an error reporting issue here;

<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
echo phpinfo();

?>
but oddly enough this php works

http://www.lovemybookkeeping.co.uk/installation/

the above is looking at index.php

however if you browse

http://www.lovemybookkeeping.co.uk/phpinfo.php

it does not work
After you made the changes to php.ini did you restart IIS? You need to do that every time. Im getting the timezone error when I visit the phpinfo page
ok changed the code still the same error you can check with the above URLs if you want to
ok just restarted iis
Also, as per your installation warning, you need to make the install directory for the web app writeable to IUSR_<=machinename>
Have you changed the timezone setting? Im still getting the same error?
Yes just checked that all is ok for permissions

what do you get when you browse to

www.lovemybookkeeping.co.uk/phpinfo.php
?
php.ini

i have attached my php.ini i think i added the timezone right
I get the following:

PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Inetpub\Wwwroot\Joomla\phpinfo.php on line 4
i wonder why i am getting something different
OK, there is a line in you ini file, change the
display_errors = off

to

display_errors = on
ok i have changed that and restarted iis
ASKER CERTIFIED SOLUTION
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Brilliant thats done it :)

Would you be able to tell me how to enable MYSQL within the php or shall i ask another question?
Looks like its working now! Its probably a good idea to turn back off the display_error directive when you are finished installing your site. Leave it on for now though!
Just uncomment the mysqli extension on this line:

;extension=php_mysqli.dll

Done, mysql support should be enabled!
ok i will award the point and thanks for you help

just quickly if you browse to this page

http://www.lovemybookkeeping.co.uk/installation/

these are requirements for a joomla addon and as you can see MYSQL Support is in red although i have just enabled it like you said above do you know of any reason why this might be, Obviously i have mysql installed

john
i think i read somewhere that in th php.ini file you have to tell it the default install directory for mysql, which in my case is c:\sql

do you think that could be it?
It may be that you havent added the correct folder for PHP extensions. F This is from the PHP site:

MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext
First off, you need to uncomment this line:

; extension_dir = "ext"

See if that sorts this issue, else you need to find libmysql.dll and stick its location in there
Ok I do have and extension directory

which is c:\php\ext

but that was already included in the zip file
Great, just uncomment that line then and you should be set :-)
Thats done it you are a Star :)))
No problem!