8 Replies - 2850 Views - Last Post: 22 July 2009 - 09:41 PM Rate Topic: -----

#1 Djanvk  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 80
  • Joined: 14-December 08

Installed PHP, MySQL and Apache, doesn't execute script, only show

Post icon  Posted 22 July 2009 - 03:33 AM

Ok I've installed PHP, MySQL and Apache Server. I'm trying a Hello World script on WC3Schools tutorial and all thats showing up on the Web Browser is the Script/Code for the hello world script not the the output of Hello World like it should be.

Any help Appreciated. How to I get Apache or Php to run the code?

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Installed PHP, MySQL and Apache, doesn't execute script, only show

#2 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 03:37 AM

are you saving your file as php? such as index.php
Was This Post Helpful? 0
  • +
  • -

#3 Djanvk  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 80
  • Joined: 14-December 08

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 04:02 AM

View Postnoorahmad, on 22 Jul, 2009 - 02:37 AM, said:

are you saving your file as php? such as index.php


Yes I am, but I think it's in the configuration of my installation, I found another tut on a website for configuring apache and php to work. I'll give that a shot, unless someone has another thing I might be missing.

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 04:10 AM

download one of the following server
WAMP (for windows)
LAMP (for Linux)
MAPM (For Mac OS)
XAMP (for all OS)
Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2982
  • View blog
  • Posts: 10,299
  • Joined: 08-August 08

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 04:49 AM

You can't open the file from the browser. You need to go through the server. Use:

http://127.0.0.1/filename.php
or
http://localhost/filename.php
but NOT:
file: open /path/to/filename.php
Was This Post Helpful? 0
  • +
  • -

#6 Djanvk  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 80
  • Joined: 14-December 08

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 08:07 PM

View PostCTphpnwb, on 22 Jul, 2009 - 03:49 AM, said:

You can't open the file from the browser. You need to go through the server. Use:

http://127.0.0.1/filename.php
or
http://localhost/filename.php
but NOT:
file: open /path/to/filename.php


I have been doing that, but it's showing the actual code not the output.

I think I will try Wamp.
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5303
  • View blog
  • Posts: 27,188
  • Joined: 10-May 07

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 08:13 PM

If you installed MySql & Apache manually, then you need to add the PHP file type to httpd.conf

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
<Files *.php>
	SetOutputFilter PHP
	SetInputFilter PHP
	LimitRequestBody 524288
</Files>



You will also have to add index.php to your index list.
Was This Post Helpful? 0
  • +
  • -

#8 PDUNZ  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 43
  • View blog
  • Posts: 375
  • Joined: 17-July 09

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 08:31 PM

and make sure in your script, you have <?PHP at the start of the file and ?> at the end.
Was This Post Helpful? 0
  • +
  • -

#9 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Installed PHP, MySQL and Apache, doesn't execute script, only show

Posted 22 July 2009 - 09:41 PM

ready this thread it will help you
Easy Start Guide to PHP By JBrace1990
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1