Can't get PHP to work!
Moderator: General Moderators
Can't get PHP to work!
I have limited knowledge of PHP, I have used someone else's code for a visitor counter and it does not work. I have tried a few of them so I know its not the code that I am using. I made a test php file that just displays a word and it does not display. My company has MS IIS running and the other PHP files work fine. They are named php4 and not php. I am trying to add php code onto the main page which is named default.htm.
The code im adding is
<? echo "Hi, I'm a PHP script!"; ?>
I am even tried using <?php instead to make sure that its not using an old version.
I have used sitemeter and it works, but this is an internal website and I cannot have anything that looks outside the site or the users will have to have internet access to see the site since we are going through a proxy.
The code im adding is
<? echo "Hi, I'm a PHP script!"; ?>
I am even tried using <?php instead to make sure that its not using an old version.
I have used sitemeter and it works, but this is an internal website and I cannot have anything that looks outside the site or the users will have to have internet access to see the site since we are going through a proxy.
.htaccess
There already are .html files that run php, my main file is called .htm I will change it and see if that works.
now my site is under construction I have to setup the main page to look for .html instead of .htm, once i figureout how.
now my site is under construction I have to setup the main page to look for .html instead of .htm, once i figureout how.
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
Re: Can't get PHP to work!
Have you talked to your IT department yet? I'm sure they can help you...james3302 wrote:My company has MS IIS running and the other PHP files work fine. They are named php4 and not php.
I could be wrong but I have never seen where and file named HTM ot HTML was able to execute php code within the page?
Are there php files within the same folder as the one that you are calling that work?
If the php files that do work on your server are in a different folder then the folder you are running your script in might not be allowed to run php.
Nickvd had it right. Chat with your IT staff
Are there php files within the same folder as the one that you are calling that work?
If the php files that do work on your server are in a different folder then the folder you are running your script in might not be allowed to run php.
Nickvd had it right. Chat with your IT staff
I will check
I will check the .htaccess file because if I name my main page default.php or default.php4 then it does not show the page. where is the .htaccess file located???
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
Re: but
You're running IIS, so you can pretty much ignore anything about .htaccess as any help you will get on it will be based on apache experience, not IIS...james3302 wrote:But if I am trying to run php code from inside a HTML file shouldn't it be in the .htaccess file???
PHP on IIS has always been a PITA... Have you talked to the administrators of your IIS server? as they are the ONLY ones who can help you...