trouble with PHP

All about creating websites!
Post Reply
User avatar
Swan
Knight of the Sword
Knight of the Sword
Posts: 827
Joined: 18 Oct 2006, 16:00
17
Contact:

trouble with PHP

Post by Swan »

Sorry guys...

being tearing my hair out, trying to get PHP to work, Ive instaled XAMPP...I know I have Apache., Mysql, and Filezilla all operative and working fine and running. Thing is when I write PHP code in notepad, save it as the .php extension and then try and view with my browser which is firefox i get a blank screen.

Ive read through a few tutorials some of them seem to want you to either config the http config or php.ini file....I was a little confused by this, asked a fellow suckoteer, who said that wasnt necessary....... :?

As i said, I'm tearing my hair out, spent the better part of 2 evenings trying to fix the damn thing.

My OS is Windows XP ... and as a footnote I amended a file about short open tags to see if that help, no avail.

I'm gonna take a guess here, I think i need to create a special folder o keep my "projects" in, but i am not sure....any advice would be much appreciated. As I said, ive tried myself, too not much success.

If you can help, I'll name my first born child after you.

User avatar
computathug
Administrator
Administrator
Posts: 2693
Joined: 29 Mar 2007, 16:00
17
Location: UK
Contact:

Post by computathug »

*off topic*
If you can help, I'll name my first born child after you.
sorry baron but "meet the parents" comes to mind.
just hope it's not "Gaylord Focker"who has the answer

sorry for the spam guys it's 3 - 15 am ad ive had a beer or two and could not resist :twisted:

User avatar
Swan
Knight of the Sword
Knight of the Sword
Posts: 827
Joined: 18 Oct 2006, 16:00
17
Contact:

Post by Swan »

;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\xampp\php\pear\"

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\xampp\php\ext\"

So based on that.......

I tried saving the stuff and placing them in the PEAR folder. No joy.

What do i do? please help guys I will dedicate a Mosque, Church, temple to you, I will stand in the street and let th and let birds eat at my feet, I will befriend beggars and feed them...just please help with this damn problem lol

User avatar
Swan
Knight of the Sword
Knight of the Sword
Posts: 827
Joined: 18 Oct 2006, 16:00
17
Contact:

Post by Swan »

Fine then....


finally resolved the error myself.

Thanks anyway guys.

Ok. SO for any other noobs who might get this hassle:

First lemme recommend XAMPP its so easy to install and you can toggle Apache on/off by clicking a button, and it has a very nifty control panel.

1. Make sure you save your file with the .php extension.
2. What I was doing was trying to open my file via the internet browser as if opening a .html file, which isnt quite correct. Rather, you must save your php file to the root directory for XAMPP this is htdocs, for WAMP this is www, and then open the file using the following syntax:

http://localhost/filename

so if file name is helloworld.php

then:

http://localhost/helloworld.php

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Finally huh? ^^
"The best place to hide a tree, is in a forest"

Post Reply