Results 1 to 6 of 6

Thread: Problems with PHP in Windows 7

  1. #1
    Join Date
    Sep 2009
    Posts
    135

    Problems with PHP in Windows 7

    I am new to dis php programming. Everything was working fine with php on my Desktop wherein I have PHP + Apache installed and the OS I am using on it is Windows XP. And now I got this new laptop from my Dad which is preinstalled with Windows 7 Professional. So I installed PHP and Apache on it, and everything was installed fine without any problem. But there is this one problem that I cannot save any file with .php extension in htdocs folder of Apache. It gives error saying You are not Authorized or something like that.
    So I have to save all my files on desktop and then copy to htdocs.
    And that's fine. But when I try to run a normal PHP program I am not able to I get the code itself in the browser instead of the output.
    Any idea why it is behaving like this.?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Problems with PHP in Windows 7

    Okay well please check if the Apache is running. I am asking this because as you mentioned that you see the code instead of output so that means there is some problem with the interpreter. The interpreter is not working fine.
    Hey try to run phpinfo() in your PHP program and see what you see in your browser.

  3. #3
    Join Date
    Sep 2009
    Posts
    135

    Re: Problems with PHP in Windows 7

    Hey thanks for replying. As I mentioned before I am a regular user of PHP and Apache on Windows XP but I don't know what's wrong with this Windows 7.
    Well I checked Apache and it is running.
    And when I try http:// 127.0.0.1 /
    It says "It works" (the html index of apache opens up).
    I also tried phpinfo() where in I get the same message.
    I tried searching on google for this issue but didn't get any proper reply. So I am completely dependent on you now. Please suggest some solution.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Problems with PHP in Windows 7

    Even I tried to install PHP 5.3.0 and Apache 2.2.1 on my system.
    And I also got the same error, even I was not able to save files in htdocs folder. When I right clicked it I got option to create a folder but on new text file.
    It may be because of UAC and windows as they are trying to protect their Programs.
    Hey try any one option from the given below.
    1) Add your user account to the NTFS permissions on the htdocs folder and give at least one write control permission.
    2) Install Apache and PHP in a different Drive and not on where you have installed Windows.
    3)Or else Disable UAC.

  5. #5
    Join Date
    Sep 2009
    Posts
    135

    Re: Problems with PHP in Windows 7

    Hey that was really easy. I installed PHP and Apache on a different Drive and that worked for me. I was able to save files with .php extension in my htdocs folder.
    But still I am not able to view output on the Browser, I still get the code itself on the Browser.
    I tried all the 3 steps given above but was not able to solve this output problem and the saving issue is resolved.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: Problems with PHP in Windows 7

    Hey have you tried editing the httpd.conf file in the Apache directory.
    You just have to add the following code in the bottom of the file.
    #PHP SETTINGS
    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/PHP"
    And the save the file and restart your system.

Similar Threads

  1. Replies: 5
    Last Post: 25-04-2011, 08:22 AM
  2. Replies: 5
    Last Post: 10-06-2010, 09:55 AM
  3. problems with windows vista
    By smileyjose in forum Operating Systems
    Replies: 2
    Last Post: 24-07-2009, 11:03 AM
  4. Problems of recognition of my 2nd windows XP
    By BoanHed in forum Operating Systems
    Replies: 4
    Last Post: 14-02-2009, 09:15 PM
  5. Replies: 4
    Last Post: 28-06-2008, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,211,787.70930 seconds with 17 queries