var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
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
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
If you don't have PHP installed, and were looking to run PHP as a CGI, I would recommend downloading the PHP binary from
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
Http://www.php.net/ and installing it.
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?
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.
I am apologizing for not clarifying the OS i use. but yes it is Windows 98
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.
I am really grateful for helping me.
Thank you very much
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.
No problems for me also installing and running Apache/PHP/MySql/ with Win98
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.
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/ "C rogram 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.