+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: PHP on LocalHost

  1. #1
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    PHP on LocalHost

    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 by richm8026; 11-17-2008 at 10:33 AM.


  2. #2
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: PHP on LocalHost

    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.

  3. #3
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: PHP on LocalHost

    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.


  4. #4
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: PHP on LocalHost

    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 by xPlozion; 11-17-2008 at 11:47 AM.

  5. #5
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: PHP on LocalHost

    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..


  6. #6
    quantum1's Avatar
    quantum1 is offline x10Hosting Member quantum1 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: PHP on LocalHost

    "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?
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

  7. #7
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: PHP on LocalHost

    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?


  8. #8
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: PHP on LocalHost

    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 Code:
    <?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;

    ?>

  9. #9
    richm8026 is offline x10 Sophmore richm8026 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    138

    Re: PHP on LocalHost

    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..


  10. #10
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: PHP on LocalHost

    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 by xPlozion; 11-17-2008 at 12:46 PM.

+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. Pregunta sobre las Configuraciones PHP
    By Trevelin in forum Soporte
    Replies: 11
    Last Post: 04-28-2008, 01:50 PM
  4. Important PHP Information
    By Bryon in forum News and Announcements
    Replies: 0
    Last Post: 11-21-2007, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers