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
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
In IIS6, look up the website properties (Right click -> choose properties) and set Home Directory -> Execute Permissions to Scripts Only or higher
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?
ASKER
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
Read and execute
List Folder Contents
Read
Still the same error though
ASKER
the permissions are set to the above
Is the folder located in Inetpub\wwwroot? Or somewhere else?
ASKER
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)
ASKER
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
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
ASKER
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
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
ASKER
ok i will try and do this again
ill post back in a bit
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.
ASKER
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\localu ser\john.p epper\www\ DDA\phpinf o.php on line 1
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(
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
ASKER
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"
date.timezone = "Europe/London"
ASKER
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
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?
ASKER
<?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();
?>
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
echo phpinfo();
?>
ASKER
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
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
ASKER
ok changed the code still the same error you can check with the above URLs if you want to
ASKER
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?
ASKER
Yes just checked that all is ok for permissions
what do you get when you browse to
www.lovemybookkeeping.co.uk/phpinfo.php
?
what do you get when you browse to
www.lovemybookkeeping.co.uk/phpinfo.php
?
ASKER
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.ph p on line 4
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(
ASKER
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
display_errors = off
to
display_errors = on
ASKER
ok i have changed that and restarted iis
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant thats done it :)
Would you be able to tell me how to enable MYSQL within the php or shall i ask another question?
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!
;extension=php_mysqli.dll
Done, mysql support should be enabled!
ASKER
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
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
ASKER
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?
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
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
; extension_dir = "ext"
See if that sorts this issue, else you need to find libmysql.dll and stick its location in there
ASKER
Ok I do have and extension directory
which is c:\php\ext
but that was already included in the zip file
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 :-)
ASKER
Thats done it you are a Star :)))
No problem!