basic php code - problem
Moderator: General Moderators
basic php code - problem
Hi Guys,
I am sorry for asking this question this is very basic stuff from PHP.
I've just started learning PHP and I have no prior knowledge in web programming.
I have installed Apache 2.2 and have installed PHP version 5.3.5 Win 32 VC9. (Using Vista )
The Apache server is configured and correctly and working. I created the following php file and saved it in document root. (using notepad)
<?php
phpinfo();
?>
The above code is everything I got in my test.php file.
When I try to view it with my browser it does not run the code but it is showing me a "open", "save" message box. It seems the code is not interpreted.
Can someone please tell me why it doesnt work? and what I can do about it? Where can the problem be?
Thank you.
Kind Regards,
Viki
I am sorry for asking this question this is very basic stuff from PHP.
I've just started learning PHP and I have no prior knowledge in web programming.
I have installed Apache 2.2 and have installed PHP version 5.3.5 Win 32 VC9. (Using Vista )
The Apache server is configured and correctly and working. I created the following php file and saved it in document root. (using notepad)
<?php
phpinfo();
?>
The above code is everything I got in my test.php file.
When I try to view it with my browser it does not run the code but it is showing me a "open", "save" message box. It seems the code is not interpreted.
Can someone please tell me why it doesnt work? and what I can do about it? Where can the problem be?
Thank you.
Kind Regards,
Viki
-
thecodewall
- Forum Commoner
- Posts: 33
- Joined: Sun Dec 26, 2010 8:37 am
Re: basic php code - problem
I think there something wrong in your setup, it doest not allow php to display. try this post http://codewall.blogspot.com/2011/01/cr ... ogram.html, It think this may help.
codewall.blogspot.com
codewall.blogspot.com
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: basic php code - problem
Just curious. How are you accessing the file in your browser?
Like this:
C:/path/to/file/test.php
or:
localhost/test.php
The later would be the correct method. Also, you need to configure your virtual host to point to the location of your public_html or www folder.
Like this:
C:/path/to/file/test.php
or:
localhost/test.php
The later would be the correct method. Also, you need to configure your virtual host to point to the location of your public_html or www folder.
Re: basic php code - problem
I had the same problem when starting out. What spedula says here is true.
Also, if using XAMPP for example, make sure your apache services etc are running.spedula wrote: C:/path/to/file/test.php
or:
localhost/test.php
Re: basic php code - problem
I am accessing the file in the following way.spedula wrote:Just curious. How are you accessing the file in your browser?
Like this:
C:/path/to/file/test.php
or:
localhost/test.php
The later would be the correct method. Also, you need to configure your virtual host to point to the location of your public_html or www folder.
localhost/test.php
Re: basic php code - problem
Thank you for the replies guys,
I will follow the advice given here and get back to you.
Thank you again.
I will follow the advice given here and get back to you.
Thank you again.
Re: basic php code - problem
Thank you, the link helped me. I am using XAMPP and it is working now.thecodewall wrote:I think there something wrong in your setup, it doest not allow php to display. try this post http://codewall.blogspot.com/2011/01/cr ... ogram.html, It think this may help.
codewall.blogspot.com
Thanks again
Re: basic php code - problem
Thank you for the advice and links, I am using XAMPP and it works perfet.
Re: basic php code - problem
Thank you guys...
I I am using XAMPP and it is perfect.
I I am using XAMPP and it is perfect.