#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Hong Kong
    Posts
    47
    Rep Power
    15
    I have installed php3 onto my web server. However, when I run php with a function (mysql_connect) ... it disappears (function not defined), how can I fix this problem?

    Thx a lot~~!!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    did you check it out any other small scripts??


    ------------------
    SR -
    shiju.dreamcenter.net
  4. #3
  5. Advisor
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Stockholm, Sweden
    Posts
    446
    Rep Power
    15
    THe easiest way to see if things are installed/configured correctly is to create
    a php-file like this:

    <? phpinfo(); ?>

    save as info.php3 or something like that...(depends on php-version)

    Access this file via you browser and watch the output.

    If mysql is properly configured with PHP and Apache you should have a row under "Extenions":

    MySQL - Client API version: 3.22.14b-gamma bla bla...

    ..something like that...

    Rgrds
    Johan
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    NY, NY,USA
    Posts
    18
    Rep Power
    0
    I'm having similiar problems as above. php is working fine for things like:
    <?php print "test"; ?>

    But won't work for mysql_ commands. I get this error:
    Call to unsupported or undefined function mysql_connect() in /home/httpd/html/test.php3 on line 12

    There is no MySQL info under extensions for me. Where do I get php to recognize my MySQL server?

    Thanks,
    Brett

    [This message has been edited by brett_webb (edited May 05, 2000).]
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Hong Kong
    Posts
    47
    Rep Power
    15
    Hi, me again!

    I know what problem comes out. But I don't know how to fix it. Can anyone help?

    The problem is:

    I upgrade Apache 1.3.12-2 and install PHP3.0.15 and MySQL with RPM. However, the script of php did not work with mysql. So, I have tried to install PHP3.0.16 and MySQL again with <tar.gz> files. This time , php works with mysql...but only works when I type command via telnet into my server : <php test.php3> ! But via browser, the <undefined function message comes out again!!

    When I have checked php3 with the script <? phpinfo(); ?> via browser, the info shows my php version being 3.0.15. However, via telnet and type <php -v>, I saw it's 3.0.16!!

    Then how to fix it??

    I have read some books about PHP. It taught me to compile PHP by typing <./configure --with-mysql --with-apache> . However, the outcome is <apache cannot find httpd.h> from server message. So, how can I do now??

    Thank you for all of you!!
    It really let me mad~~~!!

    THx again!!
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Uninstall PHP3.0.15 and PHP3.0.16 and start it over. You can keep your Apache as long as /usr/local/apache/bin/apxs can be found which I think Redhat at least install that by default.
    To reinstall php-3.0.16.tar.gz:
    tar -zxvf php-3.0.16.tar.gz
    cd php-3.0.16
    ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql
    Then check if /usr/local/apache/libexec/libphp3.so exists or not. If so, you then need to edit your httpd.conf file and enable it.
  12. #7
  13. Advisor
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Stockholm, Sweden
    Posts
    446
    Rep Power
    15
    Did freebsd's solution help you?

    In case not, here is my solution.

    I donwloaded following files:
    mysql-3.22.32.tar.gz
    apache_1.3.12.tar.gz
    php-3.0.15.tar.gz

    First of all, unpack them all:
    tar xvf *.gz

    I then installed/compiled MySQL:
    #cd mysql-3.22.32
    #./configure --prefix=/usr/local/mysql
    #make
    #make install

    After this I ran the configure file in apache (no install):
    #cd apache_1.3.12
    #./configure --prefix=/usr/local/apache

    And then I installed PHP with Apache and support for MySQL:
    #cd ../php-3.0.15
    #./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.12
    --enable-track-vars
    #make
    #make install

    Remark! --with-apache points att the installationdirectory!! --with-mysql points at the installed directory..

    and finally install apache with php-module (that includes MySQL-support):
    #cd ../apache_1.3.12
    #./configure --prefix=/usr/local/apache
    --activate-module=src/modules/php3/libphp3.a
    #make
    #make install

    #/usr/local/Apache/bin/apachectl start

    Try your phpinfo-file now!...

    Did it work?

    Rgrds
    Johan

Similar Threads

  1. Apache 2 and PHP 4
    By stanley1610 in forum Apache Development
    Replies: 2
    Last Post: February 12th, 2004, 08:20 PM
  2. php for apache
    By wannabe in forum Beginner Programming
    Replies: 3
    Last Post: February 6th, 2004, 02:28 PM
  3. PHP -> system commands
    By Tantalus in forum PHP Development
    Replies: 1
    Last Post: January 28th, 2004, 10:51 AM
  4. Replies: 4
    Last Post: January 28th, 2004, 08:29 AM
  5. Can PHP interpret Apache Directory Protection?
    By xpatriot in forum PHP Development
    Replies: 1
    Last Post: January 25th, 2004, 01:51 PM

IMN logo majestic logo threadwatch logo seochat tools logo