Results 1 to 27 of 27

Thread: Installing PHP, Apache,Mysql

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Installing PHP, Apache,Mysql

    Hey there,
    Ive got PHP & Mysql for Dummies (the Book). I want to learn Php and Mysql Databse. I started on the book, in the book is says you need to run a local webserver (it recommend apache) with mysql and php. So i started searching the internet and found this tutorial http://www.webmasterstop.com/48.html.
    Iin the tutorial i got up to finishing installing php. I then tried the test my web server to see if the php was working by making the page it tells you to then I went into the file on my browser using the link http://localhost/phpinfo.php. It only showed the "<?PHP phpinfo(); ?>" as html it didn't profomre the php. I don't think my php it working with my apache . The only thing i did different to the tutororial was use different versions of Apache, php and mysql as i couldn't find the old php and mysql. What do i need to do?

    Cheers
    ACDC
    Are the best band ever!

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Installing PHP, Apache,Mysql

    I seem to remember helping you get this working on MSN and you did have it working. What happened?

    You need to ensure the httpd.conf file has the appropriate directives to handle PHP files.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Next day i tyred to use the local server again and it didn't work, what are the directives?
    ACDC
    Are the best band ever!

  4. #4
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Installing PHP, Apache,Mysql

    try redoing the installation all over again.

    or maybe environment variables were somehow erased or something.

    what versions were you testing?

    version 4 has a slight difference but it should be not so problematic I think.. ehehehe.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Installing PHP, Apache,Mysql

    You need to check the httpd.conf file, that has the directives in it for the PHP module:
    Code:
    ### PHP Configuration
    
    LoadModule php5_module "c:/php/php5apache2.dll"
    
    AddType application/x-httpd-php .php
    
    # configure the path to php.ini
    PHPIniDir "C:/php"
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    I added that to bottom of httpd.conf file, bit when i tryed to run the server it
    had error saying there was no such file as php5apache2.dll in the php directory. I then went to the php direcotry and there was no such file.

    Another idea would it be eaiser to run my local web server on linux. Ive read somewhere that linux comes pre installed with apache and probably mysql and php so do you think i should try linux. The PHP & MYSQL for dummies teaches in both linux and windows. I can do a dual boot so i still have windows for everything else and when i want to learn some php i can use linux.
    ACDC
    Are the best band ever!

  7. #7
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Installing PHP, Apache,Mysql

    what version are you working on? php4? because the dll's for 4 is not on on php folder you have to move them.. and the file is not nameD php5apache2.. but php4apache2.dll.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Ok.
    I got a new computer and ive started fresh i followed the tutorail at http://www.vbforums.com/showthread.php?t=330825 with the versions of mysql,apache & php visuladd told me to use, he told me overmsn. They are :-

    apache_2.0.54-win32-x86-no_ssl
    mysql-4.1.12a-win32.zip
    php-5.0.4-Win32.zip

    I followed the tutorail all the way to the end were it says


    Configuring Apache

    1. You now need to edit the httpd.conf configuration file. Re-open the file as detailed in step 1 of the “Securing Apache” section.


    2. Add the following lines to the end of your http.conf file:

    Code:

    ### PHP Configuration

    LoadModule php5_module "c:/php/php5apache2.dll"

    AddType application/x-httpd-php .php

    # configure the path to php.ini
    PHPIniDir "C:/php"

    3. To complete the setup restart the Apache server as detailed in step 3 of the “Securing Apache” section



    I got up to step three then i tyred to retsart the server when i tryed and restarting the Apache server the error came up "PHP Startup: Unable to load dynamic library 'c:\PHP\ext\php_mysql.dll t' - The specified module caould not be found."

    What do i have to do?
    ACDC
    Are the best band ever!

  9. #9
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Installing PHP, Apache,Mysql

    could it be because of the extra t? at the end there?
    Sorry, I myself followed the tutorial worked fine unless I start with setting up the mbstring and the psql dlls...

  10. #10
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Installing PHP, Apache,Mysql

    I had trouble originally installing PHP, Apache, Mysql on my pc but found this tutorial and now I'm up and running. HTH

    http://www.sitepoint.com/article/php...1-installation

  11. #11
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Installing PHP, Apache,Mysql

    Oh good. , Now mark this thread resolved.

  12. #12

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Can someone just please tell me how to fix that error i get cheers!
    ACDC
    Are the best band ever!

  13. #13
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Installing PHP, Apache,Mysql

    • Cehck the file php_mysql.dll exists in the c:\php\ext directory.
    • Copy the file libmysql.dll to the directory C:\windows
    • Ensure the extension_dir directivei nthe php.ini file is pointing to C:\php\ext
    • Ensure the line extension=php_mysql.dll is uncommented in the php.ini file.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  14. #14

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Ok all that i had wrong was i had "extension=php_msql.dll" uncommented instead of "extension=php_mysql.dll".

    I changed it and then restarted my server no errors came up. YES!!
    so i continued my PHP & MYSQL for dummies book and followed what is said it said:-


    2. Create the following file somewhere in your Web space with the name
    test.php.
    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <p>This is an HTML line
    <p>
    <?php
    echo “This is a PHP line”;
    phpinfo();
    ?>
    </body></html>
    test.php
    The file must be saved in your Web space for the Web server to find it.

    3. Point your browser at the file created in Step 1. That is,
    type the name of your Web server (www.myfinecompany.com) into the
    browser address window.
    If your Web server, PHP, and the test.php file are on the same computer
    that you’re testing from, you can type localhost/test.php.
    In order for the file to be processed by PHP, you need to access the file
    through the Web server — not by choosing File➪Open from your Web
    browser menu.
    You should see the following in the Web browser:
    This is an HTML line
    This is a PHP line

    Below these lines, you should see a large table, which shows all the
    information associated with PHP on your system. It shows PHP information,
    path and filenames, variable values, and the status of various
    options. The table is produced by the line phpinfo() in the test script.
    Anytime that you have a question about the settings for PHP, you can
    use the statement phpinfo() to display this table and check a setting.

    4. Check the PHP values for the values that you need.
    For instance, you need MySQL support enabled. Looking through the
    listing, find the section for MySQL and make sure that MySQL support
    is On.

    5. Change values if necessary.
    If you don’t have administrative access to PHP, you have to ask the
    administrator to change any values that need changing. If you installed
    PHP yourself and/or have administrative access to PHP, you can change
    the values yourself. (Changing PHP settings is discussed in Appendix B.)


    I opend "test.php" through my browser and it said
    "Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 9"
    ACDC
    Are the best band ever!

  15. #15
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Installing PHP, Apache,Mysql

    Change your double quotations from

    PHP Code:
    echo “This is a PHP line”
    to

    PHP Code:
    echo "This is a PHP line"

  16. #16

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Cheers mate working sweet any more probs ill post
    ACDC
    Are the best band ever!

  17. #17

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Need help again!
    Next part of the tutorail im having problems in the tutorail it says:-


    Testing MySQL

    After you know that PHP is running okay, you can test whether you can
    access MySQL by using PHP. Just follow these steps:
    1. Create the following file somewhere in your Web space with the name
    mysql_up.php.
    You can download the file from my Web site at janet.valade.com.
    <html>
    <head><title>Test MySQL</title></head>
    <body>
    <!-- mysql_up.php -->
    <?php
    $host=”hostname”;
    $user=”mysqlaccount”;
    $password=”mysqlpassword”;
    mysql_connect($host,$user,$password);
    $sql=”show status”;
    $result = mysql_query($sql);
    if ($result == 0)
    echo “<b>Error “ . mysql_errno() . “: “
    . mysql_error() . “</b>”;
    else
    {
    ?>
    <!-- Table that displays the results -->
    <table border=”1”>
    <tr><td><b>Variable_name</b></td><td><b>Value</b>
    </td></tr>
    <?php
    for ($i = 0; $i < mysql_num_rows($result); $i++) {
    echo “<TR>”;
    $row_array = mysql_fetch_row($result);
    for ($j = 0; $j < mysql_num_fields($result); $j++)
    {
    echo “<TD>” . $row_array[$j] . “</td>”;
    }
    echo “</tr>”;
    }
    ?>
    </table>
    <?php } ?>
    </body></html>


    2. Lines 6, 7, and 8 of the program need to be changed. These lines are

    $host=”host”;
    $user=”mysqlaccount”;
    $password=”mysqlpassword”;

    Change host to the name of the computer where MySQL is installed —
    for example, databasehost.mycompany.com. If the MySQL database is
    on the same computer as your Web site, you can use localhost as the
    hostname.
    Change mysqlaccountname and mysqlpassword to the appropriate
    values. (I discuss MySQL accounts and passwords in Chapter 5.) If your
    MySQL account doesn’t require a password, type nothing between the
    quotes, as follows:

    $password=””;

    3. Point your browser at mysql_up.php.
    You should see a table with a long list of variable names and values. You
    don’t want to see an error message or a warning message. Don’t worry
    about the contents of the table. It’s only important that the table is displayed
    so that you know your connection to MySQL is working correctly.
    If no error or warning messages are displayed, MySQL is working fine. If
    you see an error or a warning message, you need to fix the problem
    that’s causing the message.
    Error and warning messages are usually fairly clear. The following is a
    common error message.

    MySQL Connection Failed: Access denied for user:
    ‘user73@localhost’ (Using password: YES)

    This message means that MySQL did not accept your MySQL account number
    or your MySQL password. Notice that the message reads YES for Using
    password but doesn’t show the actual password that you tried for security
    reasons. If you tried with a blank password, the message would read NO.
    If you receive an error message, double-check your account number and
    password. Remember that this is your MySQL account number — not your
    account number to log on to the computer. If you can’t connect with the
    account number and password that you have, you might need to contact the
    IT department or the Web hosting company that gave you the account
    number. (For a further discussion of MySQL accounts and passwords, see
    Chapter 5.)


    I Change $host=”password”; so it's got my password and $host=”host”; so it's got my host name in it (localhost), and Save. I don't change $user=”mysqlaccount”; as i have no user name for mysql i know about. I open this file through my browser and get the error.

    Parse error: syntax error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 10
    ACDC
    Are the best band ever!

  18. #18
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Installing PHP, Apache,Mysql

    Again it's the double quotations that you're using.

    What are you using to generate your double quotations? Are you using Shift and then the key to the left of your Enter key? (contains ' and ")

  19. #19

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    I changed them all after posting that reply of mine now i get all this:-

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 9

    Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11
    Error 2003: Can't connect to MySQL server on 'localhost' (10061)
    ACDC
    Are the best band ever!

  20. #20
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Installing PHP, Apache,Mysql

    The message means your mysql server is not running.

    Goto C:\mysql\bin (or where ever you installed mysql on your machine) and double click on the file winmysqladmin.exe. This will start your server.

    To have the server start each time to load Windows follow the steps below. (they were from the tutorial I linked to )

    To ensure that the server is started whenever Windows starts, you might want to create a shortcut to the program and put it in your Startup folder. This is just like creating a shortcut to any other program on your system.

    On WinNT/2000/XP/2003, you must install MySQL as a system service. Fortunately, this is very easy to do. Simply open a Command Prompt (under Accessories in the Start Menu) and run your chosen server program with the --install option:

    C:\mysql\bin>mysqld-nt --install
    Service successfully installed.

    This will install MySQL as a service that will be started the next time you reboot Windows. To start MySQL manually without having to reboot, just type this command (which can be run from any directory):

    C:\>net start mysql
    The MySQL service is starting.
    The MySQL service was started successfully.
    Last edited by lintz; Jul 16th, 2005 at 08:57 PM.

  21. #21

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    I doubled click the winmysqladmin.exe and still got the warnings and error. I restarted apache and still got the errors.

    Then i tryed doing what it says in that tutorail by open coammand and doing this command "C:\mysql\bin>mysqld-nt --install "

    I did that and it said

    The service already exists!
    The current server installed: "C:\Mysql\bin\mysqld-nt" --defaults-file="C:\Mysql
    \my.ini" MySQL


    tryed running the page again but just gpt warnings and errors.
    ACDC
    Are the best band ever!

  22. #22
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Installing PHP, Apache,Mysql

    If you are using named pipes for mysql then you need to use the hostname "." instead of localhost to connect to the server.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  23. #23

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    What is named pipes?

    I changed it anyway and the following came up:-

    Warning: mysql_connect() [function.mysql-connect]: Can't open named pipe to host: . pipe: .;c:\PHP\PEAR\;C:\Program Files\ (2) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 9

    Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11
    Error 2003: Can't connect to MySQL server on 'localhost' (10061)
    ACDC
    Are the best band ever!

  24. #24
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Installing PHP, Apache,Mysql

    before changing the hostname to "." did you start your mysql server as per my last post?

  25. #25

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Quote Originally Posted by lintz
    before changing the hostname to "." did you start your mysql server as per my last post?
    I tryed in command but it just some up with

    C:\MYSQL\BIN>mysqld-nt --install
    The service already exists!
    The current server installed: "C:\Mysql\bin\mysqld-nt" --defaults-file="C:\Mysq
    \my.ini" MySQL
    ACDC
    Are the best band ever!

  26. #26
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Installing PHP, Apache,Mysql

    There is a difference between installing and starting a service. Press Control+Alt+Delete and press the task manager, check the process list for mysql-nt.exe. If its not there you need to start the service. You can do this in the command line by typing net start mysql
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  27. #27

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    13

    Re: Installing PHP, Apache,Mysql

    Ok it's started i try run mysql_up.php through browser can get:-


    Warning: mysql_connect() [function.mysql-connect]: Can't open named pipe to host: . pipe: .;c:\PHP\PEAR\;C:\Program Files\ (2) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 9

    Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Program Files\Apache Group\Apache2\htdocs\mysql_up.php on line 11
    Error 2003: Can't connect to MySQL server on 'localhost' (10061)


    Still!!
    ACDC
    Are the best band ever!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width