Help=== problem with php on windows 7

Discussion in 'Windows 7' started by sarangbeast, Nov 4, 2009.

  1. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    #1 sarangbeast, Nov 4, 2009
    Last edited by a moderator: Apr 20, 2017
    I am a total newbie with php programming!
    I was using php+apache on my windows xp and everything was just fine on it!!!
    now i gt a new laptop with presinstalled Windows 7 professional ..
    now, after installing apache and php
    I cant directly save any file with .php extension in htdocs folder of my apache...
    it says... you are not authorized. or something like tht..
    to solve this.. i save files on desktop and thn copy to htdocs ...

    ok done with it

    now,when I run any program
    suppose a test.php like
    Code:
       1. <?php
       2. echo "TESTING";
       3. ?>


    and when i Run it like


    Code:
     localhost/test.php

    in any browser...
    the php file dosnt gt executed
    instead
    i see the same code on the browser...

    now.. I dont knw wht to doo ..and how to


    Please dont suggest me to use xampp ... I just want to knw the simple installation.. and what could be done in the matter
     
  2. Dark_Wizard

    Dark_Wizard MDL Novice

    Aug 22, 2009
    36
    1
    0
    #2 Dark_Wizard, Nov 4, 2009
    Last edited by a moderator: Apr 20, 2017
    Are you sure Apache is running? The reason I ask is because PHP is obviously not as the interpreter isn't working hence the reason you see the code as your output. Also use this as a test file name it anything you like as long as it has the php extension...

    Code:
    <?php
    phpinfo();
    ?>
    
     
  3. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    thanx for the reply mate... !!
    as I told you .. I am a regular user of apache and php on windows XP ... but now on windows 7
    Apache is working...
    as when I go for
    ht tp : // 127.0.0.1 /

    it says "IT WORKS" <<< the html index of apache comes out ...

    I tries phpinfo(); also ..

    actually ... I googled aout it long.. and din't fin anything tht could help me out... so. posted out here...
     
  4. mazodude

    mazodude MDL Junior Member

    Jan 4, 2009
    59
    2
    0
    maybe php is not installed or not installed properley

    try DLin wamp server and test it on that
     
  5. MrFerretKing

    MrFerretKing MDL Member

    Aug 25, 2009
    168
    1
    10
    I just installed Apache 2.2.1 and PHP 5.3.0 (took defaults)
    I ran into the same problem where if you try to right click on the htdocs folder and create a new text file, all i got was the create folder option only.


    It is because of UAC and windows protecting its "Programs".

    You can either do 3 things
    1. Add your user account to the NTFS permissions on the htdocs folder and give at least write control. I was able to copy in my test.php file and see it in the web browser after that.
    2. Install Apache and PHP outside of the "Program Files" folder structure
    3. Disable UAC.

    Good luck
     
  6. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    Thanx for the quick responce mate... !!
    am trying as u suggested... installing both in just C:\
    lets hope for the best :D
     
  7. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    #7 sarangbeast, Nov 4, 2009
    Last edited by a moderator: Apr 20, 2017
    (OP)
  8. MrFerretKing

    MrFerretKing MDL Member

    Aug 25, 2009
    168
    1
    10
    No it works fine.

    Did you edit your httpd.conf file in the apache subdirectory?

    Just add to the bottom of file and save, then restart apache:

    #PHP SETTINGS
    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/PHP"


    Make sure you install the thread safe version of PHP
     
  9. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    #9 sarangbeast, Nov 5, 2009
    Last edited by a moderator: Apr 20, 2017
    (OP)
  10. MrFerretKing

    MrFerretKing MDL Member

    Aug 25, 2009
    168
    1
    10
  11. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    #11 sarangbeast, Nov 5, 2009
    Last edited by a moderator: Apr 20, 2017
    (OP)
  12. sarangbeast

    sarangbeast MDL Novice

    Nov 4, 2009
    7
    0
    0
    Yipppe!! It worked :D ^_^


    now am trying to install mysql 5.0.33 on the same system ... :D

    Will bug you again only if I gt problemss with it too :p...

    Thanx A lot MrFerretKing You are a saviour ^_^