Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Newbie problem: Php script not running in browser.
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 28th April 03:53
vsrawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


I have put the first php script to hello.php file:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>

I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?>

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V
  Reply With Quote


  sponsored links


2 28th April 03:53
aballard
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


If you simply drag-and-drop the file from an explorer window into
Firefox, Firefox will display the page directly from the file system
instead of serving it through your web server. (You can tell this
because your address bar will say file:///E:/wamp/www/hello.php.) Your
browser won't parse the PHP as script; it will just think it is
malformed HTML and it would show the output you listed above.
Double-clicking the file, or dragging it into IE will try to open the
file with whatever program is associated with that extension in
Windows. (If there isn't a file association for *.php files, it will
either prompt you for a program to handle the file or it might do the
same as Firefox. I'm not sure, and I'm not really interested in
changing my file associations to test.)

IF the file is located at E:\wamp\www\hello.php AND PHP is configured
correctly AND your web server's do***ent root is E:\wamp\www\, THEN
opening http://localhost/hello.php should work.

Andrew
  Reply With Quote
3 28th April 03:53
chunich
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


And make sure the services are running/started too!
I had the same issue before then realized how forget I was!
  Reply With Quote
4 28th April 03:53
vsrawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a
blank screen. What has gone wrong?

--
V
  Reply With Quote
5 28th April 03:53
chetan_rane
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select "manage"
Next click on Services and Applications
After that Click on Services

And check if Apache is running

Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_rane@persistent.co.in | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- http://www.persistentsys.com


-----Original Message-----
From: V S Rawat [mailto:vsrawat@gmail.com]
Sent: Wednesday, August 06, 2008 2:53 PM
To: php-general@lists.php.net
Subject: Re: [php] Newbie problem: Php script not running in browser.


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a
blank screen. What has gone wrong?

--
V

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  Reply With Quote
6 28th April 03:54
chetan_rane
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Can you please check what the Do***ent Root in http.conf

Chetan Dattaram Rane | Software Engineer | Persistent Systems
chetan_rane@persistent.co.in | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- http://www.persistentsys.com


-----Original Message-----
From: V S Rawat [mailto:vsrawat@gmail.com]
Sent: Wednesday, August 06, 2008 7:22 PM
To: Chetan Rane
Subject: Re: [php] Newbie problem: Php script not running in browser.

Hi Chetan,

Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal --
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled.
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is
not used" and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to
listen on port 80.

Thanks. -- V
  Reply With Quote
7 28th April 03:54
vsrawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


windows explorer search didn't threw any file matching http.conf.

The file E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf has

# Do***entRoot: The directory out of which you will serve your
# do***ents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
Do***entRoot "e:/wamp/www/"


thanks. -- V
  Reply With Quote
8 28th April 03:54
vsrawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal --
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled.
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is
not used" and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to
listen on port 80.

Thanks. -- V
  Reply With Quote
9 28th April 14:13
v s rawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Reminder:

problem still not resolved.

not able to use php.

In the Page Source in ff3, I get:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo 'Hello World'; ?>
</body>
</html>

I do get PHP Test in my title bar?

--
V
  Reply With Quote
10 6th May 03:37
v s rawat
External User
 
Posts: 1
Default Newbie problem: Php script not running in browser.


Today, I deleted and reinstalled wampserver2.0

Thankfully, the first "Hello World" script taken from the tutorial is
working. So, I am heaving a sigh of relief that php is working this
time.

The settings in c:\wamp/bin/apache/apachex.xx/conf\httpd.conf are
Do***entRoot "c:/wamp/www/"
<Directory "c:/wamp/www/">

But, i want to have www somewhere else, say e:\wamp\www

I have changed the above two to e:\wamp\www and restarted services,
even restarted wampserver, still, the "www folder" option in the left
click menu on systray icon is opening c:\wamp\www

How do I change www to e:\wamp\www

or should I install the entire wamp server in e:\wamp itself, so that
in case of usual formatting of c and reinstall of xpsp3, my other
settings of wamp don't disappear?

Thanks.
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666