Results 1 to 10 of 10
  1. #1

    Apache server problem


    I am a newbie in learning PHP & using Apache. The problem is that after i was able to log to http://localhost

    Then i was asked to add a folder containing text & try to write http://localhost/myprog/prog1.php
    i did that but there was no success. when i connect to the internet, it acts if i want to download & it even can't download. can any one please help me

    Thanks in advanced

  2. #2
    Join Date
    Aug 2002
    Try adding this to your httpd.conf file, which can be found (in a default installation) at C:\Program Files\Apache Group\Apache2\conf\httpd.conf

    PHP Code:
    ScriptAlias /php"c:/php/" <- The folder in which PHP is installed
    AddType application
    /x-httpd-php .php
    Action application
    /x-httpd-php "/php/php.exe 
    If you don't have PHP installed, and were looking to run PHP as a CGI, I would recommend downloading the PHP binary from Http:// and installing it.
    Mark Carruth

  3. #3
    Thanks for your help

    but I'm afraid i wasn't able to find the httpd.conf

    but i might think i know the problem. couldn't it be because of the file is actually in text. i couldn't change it to .php

    so i think i may need a php editior. can you please recommend a good one?


  4. #4
    Join Date
    May 2002
    Of course you're assuming they are using Windows for Apache (most are running on linux or Unix).

    If you are using Unix/Linux type 'locate httpd.conf' to find it.

  5. #5
    I am apologizing for not clarifying the OS i use. but yes it is Windows 98

  6. #6
    Join Date
    Aug 2002
    Long Island
    Windows 98 is not a server OS. If you are going to run it on a windows platform you should use Windows 2000 pro or Windows 2000 Server using apache instead of IIS 5.0.

    You will get better performance

    The config file is located by default:

    C:\program files\Apache Group\Apache\conf\httpd.conf ** Apache **
    C:\php ** PHP **
    C:\mysql **MySQL **

    PHP config file php.ini should be located in the windows root directory.

    You must add the following lines as Mark stated in the httpd.conf file

    ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php
    Action application/x-httpd-php "/php/php.exe

    After that make sure the service is running. Windows 98 does not have this feature only Windows NT platforms.

    Good Luck

  7. #7
    Dear jtrovato,

    I am really grateful for helping me.

    Thank you very much

  8. #8
    Join Date
    Jan 2002
    If it is just for testing purpose, Windows 98 will do fine. I used it myself a lot.

    You need to find the httpd.conf file first. Try the search facility in windows (open my computer and type F3).

    When you find the file, make the changes noted by Mark-TFL. This will install PHP as a CGI interpreter.
    Ahmad Alhashemi
    PHP, Apache, C, Python, Perl, SQL
    18 related BrainBench certificates

  9. #9
    No problems for me also installing and running Apache/PHP/MySql/ with Win98

  10. #10
    As mentioned by jtrovato:
    >> Action application/x-httpd-php "/php/php.exe

    I configure it as below in httpd.conf
    >>Action application/x-httpd-php "/php4/php.exe

    IT also depends on how you did the installation for Apache/PHP for windows.

    Standard method:

    Apache installed at C:/Program Files/Apache Group/Apache/

    and php4 installed in a seperate folder c:/php4/php.exe

    Then your c:/Apache/ will have the folowing sub-folders ...bin, cgi-bin,icons,logs,modules,conf, proxy, then addig the above in httpd.conf is correct.

    You also need to add in httpd.conf the following:

    ScriptAlias /cgi-bin/ "Crogram Files/Apache Groug/Apache/cgi-bin/"

    ScriptAlias /php4/ "C:/php4/"

    AddType application/x-httpd-php .phtml .php
    AddType application/x-httpd-php-source .phps

    Restart Apache and check the installation is correct by creating a phpinfo.php file ....... <? phpinfo(); ?> and place this file in the document root of your web server. If it works fine, you will see a long page full of system and envioroment information.

    Another method is to install Apache as c:/Apache and without the php in seperate folder but as a sub-folder for example:

    c:/Apache with the c:/Apache/php4/ but this requires the httpd.conf to be configured differently.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts