PHP on LocalHost

richm8026

New Member
Messages
138
Reaction score
0
Points
0
I can't seem to get PHP working, apache is running properly, MySQL is running properly, I followed my books instructions, I placed the php-dist.ini file in C:\Windows just as it said, I couldn't find the other file, maybe that book is too hold and outdated, it does say, "PHP5" can anybody help with this matter?

Here's the error message I am getting

Code:
httpd.exe: Syntax error on line 127 of C:/Program Files/Apache Software Foundati
on/Apache2.2/conf/httpd.conf: LoadModule takes two arguments, a module name and
the name of a shared object file to load it from
Note the errors or messages above, and press the <ESC> key to exit.  10...
 
Last edited:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
well, there's a few things to try. One would be programs that install all of them with one click, already set up. they are great for testing on a windows computer. make sure that the apache config is properly setup and that php.ini is too.
 

richm8026

New Member
Messages
138
Reaction score
0
Points
0
I feel like such an idiot, this is all probably common sense and I am missing a viable piece of information somewhere, I really want this stuff to work so I can debug before uploading, that way it doesn't ruin the x10hosting, or my own account cpanel settings.
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
if the php script doesn't work, then it's not going to mess up anyone. it's just going to show you the error. i'm not really good at apache servers, because i actually use lighttpd on linux for testing and stuff like that...

looking at the above error, and mind you i'm just going off memory from years ago, there's a section in the httpd.conf file where there's a bunch of blah /loc/to/blah.so's and for php it should be
Code:
php5 /loc/to/php5.so
 
Last edited:

richm8026

New Member
Messages
138
Reaction score
0
Points
0
I think that book is just a pile of trash anyway, they had that dang Calculator in there using if this do that, do this do that, when I could have just done

Code:
select[calc]

case = 'add'

so on so forth

I think you actually fixed it for me, not sure..
 

quantum1

New Member
Messages
68
Reaction score
0
Points
0
"httpd.exe: Syntax error on line 127 of C:/Program Files/Apache Software Foundati
on/Apache2.2/conf/httpd.conf: LoadModule takes two arguments, a module name and
the name of a shared object file to load it from
Note the errors or messages above, and press the <ESC> key to exit. 10..."

What are the contents of your httpd.conf file line 127?
 

richm8026

New Member
Messages
138
Reaction score
0
Points
0
Not sure...

Hey, how can I make a GuestBook and Poll on my sites??

Can it be done using PHP, or would JavaScript be better?
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
it can easily be done using php and either mysql or a simple text file.

javascript is more for dynamic on the fly, such as effects on websites. javascript by itself cannot modify any files though, as it does not have the permissions to.

a sample mysql guestbook:

PHP:
<?php

mysql_connect('localhost', 'username', 'password');
mysql_select_db('dbname');

if (isset($_POST['submit']))
{

  $name = $_POST['name'];
  $comment = $_POST['comment'];
  $email = $_POST['email'];

  if (empty($name) || empty($comment) || empty($email))
    echo 'You left a field empty.<br /><a href="javascript:history.go(-1)">Go back</a>';

  else
  {

    $db = mysql_query("INSERT INTO guestbook ('name', 'comment', 'email') VALUES('".$name."', '".$comment."', '".$email."')");
    if ($db)
      echo 'Thank you for your comment.<br /><a href="'.$_SERVER['PHP_SELF'].'">Continue</a>';
    else
      echo 'There was an error submitting your comment';

  }
}


$result = mysql_query('SELECT name, comment FROM guestbook ORDER BY id DESC LIMIT 5');
while ($gb = mysql_fetch_assoc($result))
{
  echo '<p>',$gb['name'],':<br />',$gb['comment'],'</p>';
}

echo <<<eof

<form action='' method='post'>
  <fieldset>
    <legend>Leave a comment</legend>
    <div>
      <input name='name' type='text' /> Your Name<br />
      <input name='email' type='text' /> Your Email (Kept Private)<br />
      <textarea name='comment'></textarea> Your Comment<br /><br />
      <input name='submit' value='Submit Comment' type='submit' />
    </div>
  </fieldset>
</form>

eof;

?>
 

richm8026

New Member
Messages
138
Reaction score
0
Points
0
How do you know so much of this stuff??

I can use a GuestBook on x10 correct?

What about a Web Poll?

With like 10 Questions??

I think it would be too advanced for me to do something like that anyway, but, I am sure I would have to learn how to create StatusBars to display how many choose 1 2 3, etc., etc..
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
yes, you can use these scripts on x10. these are actually basic and use very little resources compared to the things i write and do on mine (although i don't think i use many resources actually, just does alot of work :D).

the bars would actually be easy for the polls. say you've got a total of 50 results, you would divide the results for that option/total results, and display that as a percentage. so if you had 10/50 vote on one thing, that'll come out to 20%, and just use that in the html to make a div that width ;)

i learned by experimenting and trial and error. that and i've been using php for several years now :)



as for what my few scripts do. i have a few that are run as cron jobs every weekend that synchronises the games lists on gamespot via cUrl and places new games into my database, and remove the ones that aren't there any longer. as of right now, all i do are the xbox 360 and pc games, but it's at 3am so... yea.

the other one i have manages the list of xbox360 achievements on my site. it lists any games that are missing achievement images, lists any games with "secret achievements", and any lists with errors. there's probably a couple hundred files it goes through. i can also edit the list, upload the achievement images from other sites (xbox.com) and just about anything else i want it to.
 
Last edited:

richm8026

New Member
Messages
138
Reaction score
0
Points
0
Thanks, you've been pretty helpful, I like that, a lot of people aren't willing to help as much, they just seem to leave rude comments and act ugly, LOL... I would help if I could, I'm still a newbie at this programming stuff, =(

Now, could I do the polls in a Form, or a Table??? Or does it matter either way??

Also, what does Div do? I see that TAG a lot and don't really understand it's purpose.
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
div is just like a place holder tag. what alot of people like is that they can use css to change the look of it by simply placing class='blah' or id='blah' in it. once you learn more html, it'll all come naturally. if you are going to submit any data, it must be enclosed within a <form> tag, such as my last code example. you can house the form and the fields within tables though, and you can also enclose tables within the form, and alter the layout of the fields.

as for polls, they really don't need to be in tables, as you'll most likely just use <br />'s, which are visible line breaks. the reason i say that they are visible ones, is that they are parsed to what you can see. there's also "\n" in php, which breaks the line in the source of the code, but you don't see that.

an example for a poll could be:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>test page</title>
<style type='text/css'>
<!-- HIDE FROM OLD BROWSERS

div.test
{
  background:#000;
  color:#fff;
}

END HIDE -->
</style>
</head>

<body>
<form action='' method='post'>
  <fieldset>
    <legend>poll</legend>
    <div class='test'>
      <input name='poll' type='radio' value='1' /> Option A<br />
      <input name='poll' type='radio' value='2' /> Option B<br /><br />
      <input name='submit' value='place vote' type='submit' />
    </div>
  </fieldset>
</form>
</body>
</html>
 
Last edited:

richm8026

New Member
Messages
138
Reaction score
0
Points
0
Well, I am still trying to master Frames, I want to get my HTML Certificate online on w3schools.com but I need to learn all this stuff before attempting it, if you know what I mean, they said there's 75 Questions and you can only miss 10 I believe they said..
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
an html certificate is unnecessary imo, especially since it cost's money. if you're looking to become a developer, people are going to care more about what you can make that what certs you have. a resume with good designs should be, imo, more valuable than someone who's got a cert but can't design better than a 2nd grader.
 

richm8026

New Member
Messages
138
Reaction score
0
Points
0
So, I'm doing this Online Web Design Course for no reason??

Anyway, I'd rather be a code man than a Look and feel man, I like to read codes, I suck at designing, LOL
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
well, if it's free, then no. if you're paying for it, and it's paid in full, i'd finish it. free lessons, such as those given by w3schools and other sites are great for learning the basics and fundamentals of html. you have to start some where to learn it, i went down that road, and after a few years, it's natural. you can program without knowing any html, but most of the time they go hand in hand, especially if you're the sole developer.
 

richm8026

New Member
Messages
138
Reaction score
0
Points
0
Do you have AIM, or Yahoo!?

I know that nobody on here likes PMs, so that's why I don't leave none,

It says you're a Xlieutenant(spelling)..

That must be at the top of the ranks..

Anyway, I'm here, I usually get about 5 hours of a sleep a day, I have a hard time sleeping..

I'm doing Web Design at ITT Technical Institute, wasting my time for sure, but I have met a few interesting people on there though..
 

natsuki

New Member
Messages
112
Reaction score
0
Points
0
LoadModule in httpd.conf is like this:
LoadModule ssl_module modules/mod_ssl.so
httpd.exe is Apache itself, meaning apache is the one having an error.
go to line 127 of httpd.conf and check. Or just comment it (put # before it) if you don't really need it lol
 
Last edited:

richm8026

New Member
Messages
138
Reaction score
0
Points
0
I think that's the one that is LoadModule php5apache2.dll one I believe, after I got that error message I just removed apache and PHP.. I did download newer testing ones, that's probably the reason why I'm having problems
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
i think for php it should be
Code:
LoadModule php5 modules/mod_php5.so
or something like that. as i've mentioned, it's been a while :D

i don't mind pms like the staff and other members do. as long as somebody doesn't spam my inbox with a hundred pms in 5 minutes, im ok. and yea, i've got aim.
 
Last edited:
Top