Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 65
  1. #11
    Join Date
    Feb 2004
    Location
    CA
    Posts
    200
    try using

    <?php

    instead of
    <?

    to open the script. I had the same problem until I used <?php

    Hope that helps.

    Lent

    edit: This was only helping me with browser windows where nothing would show up, not the undefinded function error.
    Last edited by lent; 01-23-2006 at 01:52 PM.
    -Lent

  2. #12
    Join Date
    Dec 2003
    Location
    Tananger, Norway
    Posts
    1,461
    Lent: to solve that just open the php.ini file and find short_open_tags and set it to 1. Then you should be able to use <? too.

  3. #13
    Join Date
    Feb 2006
    Posts
    2

    Unhappy Help!!

    Hi - I am wodering if there is anyone out there whop can help me.
    I have been following and adhering to the Mysql/Apache/PHP tutorials rigorously. So far I have managed to install and set up:
    Apache 2.0.55
    PHP 5.1.2
    MySQL 5.0.17

    I have managed to get as far the first 10 lessons with no problem. I have got HTML pages and the PHP test page to run on Apache. I have managed to get Mysql up and running creating database and tables...

    BUT I CANNOT SEEM TO GET PHP TO RUN WITH MYSQL.

    So far I have followed instructions to the letter.
    In Webroot I have place the following PHP file:

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
    $connection = mysql_connect ($db_host, $db_user, $db_password) or die ("error connecting");
    echo "connection made";
    ?>

    where db_config.php is situated in Webroot/config containg the text:

    <?php
    $db_host = "localhost";
    $db_user = "php";
    $db_password = "violin";
    $db_name = "brucedb";
    ?>

    THE RESULT IS NOTHING - THE WEBPAGE IS BLANK!

    I since found out that there were special instructions on this thread which I followed (especially step 3.2) but still to no avail. Mysql has been set up using the "standalone" instructions and then I have reopened the prompt screen which now has the following content:

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Supervisor>cd C:\

    C:\>cd program files\mysql\mysql server 5.0\bin

    C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root -p
    Enter password: ******
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 1 to server version: 5.0.17-nt

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> GRANT ALL ON *.* to php@'localhost'IDENTIFIED BY's3cret';
    Query OK, 0 rows affected (1.30 sec)

    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.37 sec)

    mysql> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | brucedb |
    | mysql |
    | test |
    +--------------------+
    4 rows in set (0.71 sec)

    mysql> use brucedb;
    Database changed
    mysql>


    I cannot think of any further information to give you but I would really appreciate your help if there is anyone out there to help.
    Thanks

  4. #14
    Join Date
    Feb 2003
    Location
    UK
    Posts
    1,720

    Thumbs up cool guide!

    nchris After following your cool install guide I found I got PHP v5.1.2 , MySQL v4.1.7 and Apache v2.0.55 all to work fine together. I liked the idea of adding PHPIniDir "F:/php"(mines installed on F drive) to the http.conf as this saves copying the php.ini to the c:\windows now. But although I added the line F:\PHP to my Environment Variables Path I still was unable to get the PHP to talk to MYSQL. So I copied these DLLs to my C:\windows\system32(XP Pro) directory libmysql.dll, php_mysql.dll and php5ts.dll and restarted Apache and now it all works great so thank you nchris for all your hard work.

    I too have been following the VTMs and I have these php files done and working at the time of writing this email:-
    phpinfo
    index.php
    counter
    Guestbook
    Iftest
    loop
    temp_con
    vartest

    Although I am using the latest PHP and Apache I have yet to try this with the latest MySQL. If I do try MySQL v5.0.19 then do I use the MYSQL v5.0.19 win32 Essentials.msi or MYSQL v5.0.19 win32.exe?

    Edit: The only part of your instructions I didn't do was the GRANT ALL ON *.* to php@'localhost' IDENTIFIED BY 's3cret'; part.

    Baroo Have you copied the three DLLs I mentioned above in to you C:\windows\system32 directory then restarted Apache?

    Ironcheese I have phpMyAdmin working fine but the only two things different between use are the version numbers of the software. I think you need to copy the three DLLs I mentioned above too.

    Let me know if I help anyone as 1 noob to another
    WindyBut
    Intel i7 x5960 @ 4.6GHz (8 cores) | Asus Titan X x2 + MSI Titan X x2 | Asus ROG Rampage V Extreme | 16Gb Corsair Quad Ram | 1 BuRay Writer | 4 x 1TB HD's | Asus PB287Q 4K Gaming Monitor + Dell 24" Monitor | 1500W PSU | 150 Mbps Internet with NTL | Win 10 64 | My Home Page

  5. #15
    Join Date
    Mar 2006
    Location
    Austarlia
    Posts
    46

    help

    can some one help me please as I am stuck I have done everything you said and got everything installled and set up and have created the user php but I can't change to the user php and when I open the mysql command prompt I have to type in my password and my mysql doesn't seem to stop running even when my pc is turned off I am very knew to this but am trying my hardest to understand it all

  6. #16
    Join Date
    Mar 2002
    Location
    Denmark
    Posts
    684
    can some one help me please as I am stuck I have done everything you said and got everything installled and set up and have created the user php but I can't change to the user php and when I open the mysql command prompt I have to type in my password and my mysql doesn't seem to stop running even when my pc is turned off I am very knew to this but am trying my hardest to understand it all
    alright, if I understand you correctly you want to be able to log in using the newly created php account...

    mysql command prompt type this
    mysql -u php -p

    Now you should be asked for the password for user php, enter the password and you should be logged into the mysql server using the php account...

    from a php script try usng this
    $connection = mysql_connect ("localhost", "php", "s3cret");

    Most people like to split the this up into two files, one where they assign values to variables and then include this file where they need a connection... Like so

    ----db.php-----
    <?php
    $db_host = "localhost";
    $db_user = "php";
    $db_password = "s3cret";
    $db_name = "3dbuzz";
    ?>

    ----yetanotherphpfile.php----
    require_once("db.php") //requires that db.php is in same folder as yetanotherphpfile.php
    $connection = mysql_connect ($db_host, $db_user, $db_password) or die ("error connecting");


    The next question/concern that your mysql server keeps running even after you turn off your computer, well seeing as the server runs on the same machine you ahve just turned off it is Highly(and by that I mean HIGHLY) unlikly, if not impossible, that anything is still running on the machine. what makes you think that mysql is still running even after you have turned off your machine? is mysql running on another machine?
    ~Chris

  7. #17
    Join Date
    Mar 2006
    Location
    Austarlia
    Posts
    46
    because when I turned my pc back on after about 2 hrs away and I checked the status of mysql it said uptime was over 4 hrs instead of a couple of minutes and it doesn't ask me for a password for php it does nothing

  8. #18
    Join Date
    Mar 2006
    Location
    Austarlia
    Posts
    46
    Enter password: ******
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 3 to server version: 5.0.19-nt

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> use mysql;
    Database changed
    mysql> mysql -u php -p
    ->
    that is all I get I need help please

  9. #19
    Join Date
    Mar 2006
    Location
    Austarlia
    Posts
    46
    Enter password: ******
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 3 to server version: 5.0.19-nt

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> use mysql;
    Database changed
    mysql> mysql -u php -p
    -> show tables;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'mysql
    -u php -p
    show tables' at line 1
    mysql> show tables;
    +---------------------------+
    | Tables_in_mysql |
    +---------------------------+
    | columns_priv |
    | db |
    | func |
    | help_category |
    | help_keyword |
    | help_relation |
    | help_topic |
    | host |
    | proc |
    | procs_priv |
    | tables_priv |
    | time_zone |
    | time_zone_leap_second |
    | time_zone_name |
    | time_zone_transition |
    | time_zone_transition_type |
    | user |
    +---------------------------+
    17 rows in set (0.01 sec)

    mysql> select * from user\G
    *************************** 1. row ***************************
    Host: localhost
    User: root
    Password: *283C700144B8BD4F0B9EAF71835DFAE9030129CC
    Select_priv: Y
    Insert_priv: Y
    Update_priv: Y
    Delete_priv: Y
    Create_priv: Y
    Drop_priv: Y
    Reload_priv: Y
    Shutdown_priv: Y
    Process_priv: Y
    File_priv: Y
    Grant_priv: Y
    References_priv: Y
    Index_priv: Y
    Alter_priv: Y
    Show_db_priv: Y
    Super_priv: Y
    Create_tmp_table_priv: Y
    Lock_tables_priv: Y
    Execute_priv: Y
    Repl_slave_priv: Y
    Repl_client_priv: Y
    Create_view_priv: Y
    Show_view_priv: Y
    Create_routine_priv: Y
    Alter_routine_priv: Y
    Create_user_priv: Y
    ssl_type:
    ssl_cipher:
    x509_issuer:
    x509_subject:
    max_questions: 0
    max_updates: 0
    max_connections: 0
    max_user_connections: 0
    *************************** 2. row ***************************
    Host: %
    User: root
    Password: *283C700144B8BD4F0B9EAF71835DFAE9030129CC
    Select_priv: Y
    Insert_priv: Y
    Update_priv: Y
    Delete_priv: Y
    Create_priv: Y
    Drop_priv: Y
    Reload_priv: Y
    Shutdown_priv: Y
    Process_priv: Y
    File_priv: Y
    Grant_priv: Y
    References_priv: Y
    Index_priv: Y
    Alter_priv: Y
    Show_db_priv: Y
    Super_priv: Y
    Create_tmp_table_priv: Y
    Lock_tables_priv: Y
    Execute_priv: Y
    Repl_slave_priv: Y
    Repl_client_priv: Y
    Create_view_priv: N
    Show_view_priv: N
    Create_routine_priv: N
    Alter_routine_priv: N
    Create_user_priv: N
    ssl_type:
    ssl_cipher:
    x509_issuer:
    x509_subject:
    max_questions: 0
    max_updates: 0
    max_connections: 0
    max_user_connections: 0
    *************************** 3. row ***************************
    Host: localhost
    User: php
    Password: *B865CAE8F340F6CE1485A06F4492BB49718DF1EC
    Select_priv: Y
    Insert_priv: Y
    Update_priv: Y
    Delete_priv: Y
    Create_priv: Y
    Drop_priv: Y
    Reload_priv: Y
    Shutdown_priv: Y
    Process_priv: Y
    File_priv: Y
    Grant_priv: N
    References_priv: Y
    Index_priv: Y
    Alter_priv: Y
    Show_db_priv: Y
    Super_priv: Y
    Create_tmp_table_priv: Y
    Lock_tables_priv: Y
    Execute_priv: Y
    Repl_slave_priv: Y
    Repl_client_priv: Y
    Create_view_priv: Y
    Show_view_priv: Y
    Create_routine_priv: Y
    Alter_routine_priv: Y
    Create_user_priv: Y
    ssl_type:
    ssl_cipher:
    x509_issuer:
    x509_subject:
    max_questions: 0
    max_updates: 0
    max_connections: 0
    max_user_connections: 0
    3 rows in set (0.09 sec)

    mysql>
    the php is there it just wont ask me for a password so I can login to that account

  10. #20
    Join Date
    Mar 2002
    Location
    Denmark
    Posts
    684
    uhm.. well you have already logged into it when you type mysql -u php -p

    so don't do that, in a command prompt just type mysql -u php -p
    and thats it...
    ~Chris

Page 2 of 7 FirstFirst 1234 ... LastLast

Posting Permissions

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