/    Sign up×
Community /Pin to ProfileBookmark

PHP or Apache?

Ok, so I just installed PHP 5 and Apache 2.0.53 on my computer, and wanted to test out if all is ok. I made a simple form, but when I click submit, it gives me “Page cannot be displayed”. Does this mean I didn’t install PHP properly? Or Apache?

Looking at my Apache Icon, it says “Running all apache services”, and there’s a green light beside Apache2.

I will post my script just in case it’s because of the script I have. I just took it off a website to test it out.

<HTML>
<body>

<form method=”post” action=”sendmail.php”>
Email: <input name=”email” type=”text” /><br />
Message:<br />
<textarea name=”message” rows=”15″ cols=”40″>
</textarea><br />
<input type=”submit” />
</form>
</body>
</HTML>

and my php file is this:

[code=php]
<?
$email = $_REQUEST[’email’] ;
$message = $_REQUEST[‘message’] ;

mail( “[email protected]”, “Feedback Form Results”,
$message, “From: $email” );
header( “Location: http://www.blah.com” );
?>
[/code]

to post a comment
PHP

11 Comments(s)

Copy linkTweet thisAlerts:
@JonaApr 08.2005 — [font=trebuchet ms]Did it work when it was online? If so, it's Apache. If not, it's PHP.[/font]
Copy linkTweet thisAlerts:
@JayMauthorApr 08.2005 — Nope. It didn't work when I tried it online. I think it's a problem with my PHP. I tried this script, and didn't receive any message from the PHP code:

[code=php]
<html>
<p>If PHP is working, you will see "Hello World" below:<hr>
<?php
echo "Hello world";
phpinfo(); // Print PHP version and config info
?>
</html>

[/code]


Edit: Should I try to re-install PHP?
Copy linkTweet thisAlerts:
@JonaApr 08.2005 — [font=trebuchet ms]I'm assuming you know that your document should have a [i].php[/i] extension. Reinstalling would be a good idea to get everything fresh and renewed. Sometimes configurations can get really screwed up for no apparent reason.[/font]
Copy linkTweet thisAlerts:
@Stephen_PhilbinApr 08.2005 — I'd be willing to bet it's something very simple like a typo in a file name somewhere or that one file is in a seperate folder from another.

Oh wait, that'd give a 404 wouldn't it. D'oh!

What address are you using in your browser to call the page?
Copy linkTweet thisAlerts:
@bokehApr 08.2005 — That script won't work anyway on a local machine running windows unless you are running a local mailserver or your ISP doesn't require authentication (very rare). Also you would need to set your send mail parameters in php.ini. Have you checked your apache config file to see if it is loading the php module or if it is commented out. Page can not be displayed IS an apache error page but that doesn't prove anything.

By the way did you load a package? If so which one?
Copy linkTweet thisAlerts:
@JayMauthorApr 08.2005 — I just followed the exact installation instructions given on PHP.net for the installation of both PHP and Apache.

I checked the 'Error Log File' for apache, and this is a part of the log. Perhaps this might help you guys help me. I will double check my PHP installation to make sure all is right.

[Thu Apr 07 18:06:22 2005] [notice] Apache/2.0.53 (Win32) configured -- resuming normal operations

[Thu Apr 07 18:06:22 2005] [notice] Server built: Feb 10 2005 06:11:34

[Thu Apr 07 18:06:22 2005] [notice] Parent: Created child process 1112

[Thu Apr 07 18:06:22 2005] [notice] Child 1112: Child process is running

[Thu Apr 07 18:06:22 2005] [notice] Child 1112: Acquired the start mutex.

[Thu Apr 07 18:06:22 2005] [notice] Child 1112: Starting 250 worker threads.

[Thu Apr 07 20:03:04 2005] [notice] Apache/2.0.53 (Win32) PHP/5.0.4 configured -- resuming normal operations

[Thu Apr 07 20:03:04 2005] [notice] Server built: Feb 10 2005 06:11:34

[Thu Apr 07 20:03:04 2005] [notice] Parent: Created child process 512

[Thu Apr 07 20:03:04 2005] [notice] Child 512: Child process is running

[Thu Apr 07 20:03:04 2005] [notice] Child 512: Acquired the start mutex.

[Thu Apr 07 20:03:04 2005] [notice] Child 512: Starting 250 worker threads.

[Thu Apr 07 22:30:48 2005] [notice] Apache/2.0.53 (Win32) PHP/5.0.4 configured -- resuming normal operations

[Thu Apr 07 22:30:48 2005] [notice] Server built: Feb 10 2005 06:11:34

Thanks for the help guys.
Copy linkTweet thisAlerts:
@JayMauthorApr 08.2005 — That script won't work anyway on a local machine running windows unless you are running a local mailserver or your ISP doesn't require authentication (very rare). Also you would need to set your send mail parameters in php.ini. Have you checked your apache config file to see if it is loading the php module or if it is commented out. Page can not be displayed IS an apache error page but that doesn't prove anything.

By the way did you load a package? If so which one?[/QUOTE]


I did not alter anything in the php.ini file. I assume it's not necessary to begin writing simple php code, right? .

I'm not sure what you mean by 'load a package'. The only things that I installed on my computer is PHP 5.0.4 and Apacha 2.0.53 .
Copy linkTweet thisAlerts:
@bokehApr 08.2005 — I did not alter anything in the php.ini file. I assume it's not necessary to begin writing simple php code, right? .

I'm not sure what you mean by 'load a package'. The only things that I installed on my computer is PHP 5.0.4 and Apacha 2.0.53 .[/QUOTE]


By a package I mean something like XAMPP or appserv. There is one install file, preconfigured and this loads apache, php, mysql and sometimes perl and other bits and pieces.

To send mail you certainly would have to modify your php.ini file. Also php for windows can not send an email password so you would need a mailserver that does not requiere one.
Copy linkTweet thisAlerts:
@JayMauthorApr 09.2005 — Please excuse my ignorance; I have fixed the problem ? . Looking at my php file again, notepad was saving it as sendmail.php.[B]txt[/B] even though I was typing "sendmail.php". I had to change it from "text file" to "all files" :p . Everything's working now. Thanks for the help.
Copy linkTweet thisAlerts:
@JonaApr 09.2005 — [font=Trebuchet MS]...lol... Never dreamed it'd be that...[/font]
Copy linkTweet thisAlerts:
@JayMauthorApr 09.2005 — [font=Trebuchet MS]...lol... Never dreamed it'd be that...[/font][/QUOTE]

I know. I think as programmers we are brainwashed to look into the most complicated things and we forget the simple, [I]extremely simple[/I] things. :rolleyes:
×

Success!

Help @JayM spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...