-
I am starting to learn pHp from the very beginning, I have installed pHp, Apache, and mySQL in my windows 98.
I wrote the html that will show todays' date using notepad. I have the file saved as .php as well as .html
My problem is that I can't see any result if I open the html, but I can see the result if I open the .php file.( it shows the result very quick and shut down the .php file by itself)
I don't think this is the right way to view the file. I supposed the file should be view in .html
I opened Apache, php when I tried that.
Please advice.
Thanks very much.
-
Put the PHP file in your root web and type: http://localhost/filename.php into your web browser address bar.
-
I installed the apache, mySQL and php in drive D.
I don't understand when do you mean by root web.
-
Apache installs a root web. Most likely it will be D:\APACHE\HTDOCS
That folder will be your Root Web. You can find out more about this in your Apache Documents. You would put all your files in this folder just as if you were putting them on your webserver. Then by using http://localhost/filename.ext you can load the different files. It works just like if you were browsing the Internet just use localhost as your domain name.
-
THanks, I have found my root web.
The .php file can be open but with no result shown. I'm testing the short php that to show today's date from web tutorial.
I wonder if this happened due to the setting of php or apache (httpd.conf file) as all this I've installed in drive D. Maybe I have to change the setting somehow?
-
Indeed, you need to configure Apache to use PHP to process .php files before sending them to the Web browser. My tutorial explains how to do this under Linux. Unfortunately, configuring Apache to use PHP under Windows can be quite difficult. For this reason, and because Apache can be comparatively slow under Windows, I tend to recommend Sambar Server for tring out PHP under Windows. See my post here for installation instructions.
-
Does anyone know how to configure in apache or pHp (for my case as stated above) since I have it installed already?
-
You are going to need to put the following into your httpd.conf file
#Make this the correct path to your php executable
ScriptAlias /php/ "C:/Inetpub/scripts/php/"
AddType application/x-httpd-php .php .php3 .phtml .html .htm
AddType application/x-httpd-php-source .phps
Action application/x-httpd-php "/php/php.exe"
-
Thanks everyone,all of you have help me a lot, especially to freddy, You have really answered my question. :)