User | Post |
random
Posts: 21/32 |
did you configure php properly with apache? It's doesn't configure automaticly you have to edit some files. |
Dylan
Posts: 853/1407 |
Ah, none of that worked. Its probably something I overlooked when configuring Apache. |
DarkSlaya
Posts: 2022/4249 |
Normaly you should be able to open the file like this: http://localhost/test.php OR http://127.0.0.1/test.php
Which are the same. Or else you can try: http://insert ip here/test.php
If nothing works, see if apache is running (We never know) |
Dylan
Posts: 849/1407 |
Originally posted by dan Open your Apache's httpd.conf file (located in the 'conf' directory), and find the setting for DocumentRoot. It should tell you the directory on your system that you should put the scripts in.
Yeah, the DocumentRoot is Apache2/htdocs, like I said. It still locks up when I try to access http://localhost/phpfile.php(when phpfile.php is in htdocs). Hmm.
Edit: In httpd.conf, I see a line that looks like: ServerName mdg-bzj30pmtond.slnt.phub.net.cable.rogers.com:80 Do I need to change "mdg-bzj30pmtond.slnt.phub.net.cable.rogers.com:80" to "localhost"? Or open the test file in http://mdg-bzj30pmtond.slnt.phub.net.cable.rogers.com:80/test.php?
Edit: I experimented with the above, and nothing has worked. |
dan
Posts: 160/782 |
Open your Apache's httpd.conf file (located in the 'conf' directory), and find the setting for DocumentRoot. It should tell you the directory on your system that you should put the scripts in. |
Dylan
Posts: 847/1407 |
Originally posted by dan Your file association in Windows has nothing to do with how a web server on your system renders the page. It sounds like he's either not got PHP installed, or is running the page by double-clicking it in explorer. (Which you shouldn't do)
No I have a php interpreter with fast-cgi installed along with Apache. They are both configured properly. Dan, your first post helped a bit. I opened it with localhost; but I am not sure if I have the dir correct. Apache/htdocs/filewithphp.php? I believe thats the root directory of the local server. And do I literally open it like http://localhost/filewithphp.php, or do I need something to replace localhost? How can I find that? |
dan
Posts: 157/782 |
Your file association in Windows has nothing to do with how a web server on your system renders the page. It sounds like he's either not got PHP installed, or is running the page by double-clicking it in explorer. (Which you shouldn't do) |
Modereb
Posts: 40/75 |
Think it's more of a File Association problem than a programming problem.
In a Windows Explorer window, go to 'Extra', then 'Map Options' (bottom item in the menu under 'Extra'), and then the third Tab 'Extensions'. Here you can change with what program every file type will be opened.
Or, just open your browser window and go to the URL/location of the PHP file itself. |
dan
Posts: 154/782 |
What is your script's code, and are you accessing it through http://localhost/whereverthescriptis, instead of C:\documents and settings\user\whateverthescriptis? |
Dylan
Posts: 840/1407 |
Well, I decided to start a bit of php. I don't plan to put anything on the web, I just wanna test stuff locally, you know, to learn. So I downloaded all the neccessary fixings to power it, but I have a small problem. I made a very simple little script in a note doc and saved it as a .php, but it turns into a microsoft picture it! file. Now, I understand that picture it files also have the extension .php. So, how can I get around this? I don't even know if this is causing the problem, because it opens in the browser. Problem is, its just a blank page. Well actually, html is displayed, but any blocks of php are ignored. Hmm... help! |