Results 1 to 6 of 6
Hi:
I have a new problem now. I have installed Redhat 9.0 and Apache, PHP and MySQL are packages that came with RH9. I was able to initialise and start ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-26-2003 #1Just Joined!
- Join Date
- Jun 2003
- Posts
- 6
How to Run PHP Scripts
Hi:
I have a new problem now. I have installed Redhat 9.0 and Apache, PHP and MySQL are packages that came with RH9. I was able to initialise and start Apache and MySql. But coming to PHP, i dont know how to initialize it. From some of my friends i came to know that Apache+LINUX have the feature of automatically executing PHP scripts too. But when i created a basic HTML file "Hello World" and tried to open it..it shows me the entire HTML code..i dont know where to save the PHP and HTML files that i create and how can i view my HTML File.I tried saving the HTML file in var/www/HTML/mrtg folder and open my file. all the files in the folder open up except for my file. Please help me in this so that i can go ahead and start my web application. There are no syntax errors in my file thats for sure...the code in my file goes like this
<html>
<head>
<title>check</title>
</head>
<body>
Checking the file
</body>
</html>
Do i need to edit the httpd.conf file to initialise it to run PHP. if yes how can i go about doing that.
- 06-26-2003 #2
I think your post is a bit unclear.
I assume you have not modified httpd.conf and that the service is running?
By default the Apache server is using /var/www/html as default diectory.
If you open a browser and type http://localhost than you should see a page appearing. It has some textsaying that your server is up and running.
Place a file in this directory and named it, for example, test.php
Insert the following in the file
now run http://localhost/test.php and if php is running you should see a page with a lot of details on your apache/php setupCode:<? phpinfo(); ?>
try this first. I am not sure if you have to enable php in httpd.conf when you install it from the packages.
I added the following manually om my freebsd box
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
Cheers
- 06-27-2003 #3Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
You need to uncomment the php-module in /etc/httpd/conf/httpd.conf and the just put a index.php file in your wepagedirectory... try to create and index with this text in...
RegardsCode:<?php echo "Hello World....do you see this text??"; ?>
Regards
Andutt
- 06-27-2003 #4Linux User
- Join Date
- May 2003
- Location
- Hong Kong, China
- Posts
- 256
there is a very detailed guide in the official php website, www.php.net
I am working on it as well. LOLSignature removed by moderator - please see forum rules
- 07-01-2003 #5Just Joined!
- Join Date
- Jun 2003
- Posts
- 6
Thanks everyone. I am able to run my php pages now. I had to edit the httpd.conf file and add in the loadModule and addApplicationType and it worked. Thanks again. This forum is a lot more helpful to me.
- 07-01-2003 #6Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
Good...thats why we are here...to help people.
RegardsRegards
Andutt


Reply With Quote
