Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - .php files format and display | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
Dylan Devil Trumpets and Angel Trombones ~ Level: 54 Posts: 840/1407 EXP: 1181697 For next: 52173 Since: 06-19-04 From: Ottawa, Canada. Since last post: 1 day Last activity: 6 hours |
| ||
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! | |||
dan Snap Dragon Level: 43 Posts: 154/782 EXP: 534516 For next: 30530 Since: 03-15-04 Since last post: 20 hours Last activity: 14 hours |
| ||
What is your script's code, and are you accessing it through http://localhost/whereverthescriptis, instead of C:\documents and settings\user\whateverthescriptis? | |||
Modereb Paragoomba Level: 15 Posts: 40/75 EXP: 14749 For next: 1635 Since: 06-04-04 Since last post: 350 days Last activity: 339 days |
| ||
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 Snap Dragon Level: 43 Posts: 157/782 EXP: 534516 For next: 30530 Since: 03-15-04 Since last post: 20 hours Last activity: 14 hours |
| ||
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) | |||
Dylan Devil Trumpets and Angel Trombones ~ Level: 54 Posts: 847/1407 EXP: 1181697 For next: 52173 Since: 06-19-04 From: Ottawa, Canada. Since last post: 1 day Last activity: 6 hours |
| ||
Originally posted by dan 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? (edited by GB-K on 09-04-04 12:49 PM) |
|||
dan Snap Dragon Level: 43 Posts: 160/782 EXP: 534516 For next: 30530 Since: 03-15-04 Since last post: 20 hours Last activity: 14 hours |
| ||
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 Devil Trumpets and Angel Trombones ~ Level: 54 Posts: 849/1407 EXP: 1181697 For next: 52173 Since: 06-19-04 From: Ottawa, Canada. Since last post: 1 day Last activity: 6 hours |
| ||
Originally posted by dan 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: 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. (edited by GB-K on 09-04-04 03:13 PM) |
|||
DarkSlaya POOOOOOOOOOOORN! Level: 88 Posts: 2022/4249 EXP: 6409254 For next: 241410 Since: 05-16-04 From: Montreal, Quebec, Canada Since last post: 8 hours Last activity: 5 hours |
| ||
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 Devil Trumpets and Angel Trombones ~ Level: 54 Posts: 853/1407 EXP: 1181697 For next: 52173 Since: 06-19-04 From: Ottawa, Canada. Since last post: 1 day Last activity: 6 hours |
| ||
Ah, none of that worked. Its probably something I overlooked when configuring Apache. | |||
random Goomba Level: 10 Posts: 21/32 EXP: 3871 For next: 543 Since: 08-02-04 From: Eastern Deathville Since last post: 387 days Last activity: 276 days |
| ||
did you configure php properly with apache? It's doesn't configure automaticly you have to edit some files. |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - .php files format and display | | | |