The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Strange problem with PHP 5.1.x and MySQL 4.1.x

Discussion in 'General Discussion' started by nickg78, Jul 28, 2006.

  1. nickg78

    nickg78 Member

    May 7, 2004
    Likes Received:
    Trophy Points:
    Athens, Greece
    cPanel Access Level:
    Root Administrator
    Hello all,

    after updating MySQL to 4.1.20 on my Linux server, I started having some slight problems with PHP 5.1.4 connecting to it. Before upgrading MySQL to 4.1.20, I had PHP 5.1.4 and MySQL 4.0.27 installed. Everything worked fine.
    After upgrading MySQL to 4.1.20, I had to downgrade PHP to version 4.4.2. With PHP 5.1.4 all scripts that used the mysql_connect function stopped working and the browser prompted to download them. :eek: (and if I clicked ok, actually, a zero bytes php file was downloaded). Even a simple php file with only one line:
    mysql_connect("localhost", "username", "password");
    prompts me to download it. All other scripts (not using a MySQL connection) worked fine in PHP 5.1.4. I double checked the httpd.conf and php.ini but nothing strange was there. After downgrading to PHP 4.4.2, all the scripts where again working fine with MySQL 4.1.20. I tried reinstalling MySQL, PHP 5.1.4 but this didn't help.

    So, here is a conclusion:
    - PHP 4.4.2 and 5.1.4 working fine with MySQL 4.0.27
    - PHP 5.1.4 doesn't work with MySQL 4.1.20 (all .php scripts containing the mysql_connect function, are parsed blank and prompt for download, no error about undefined function or failed connection... just a blank page).
    - PHP 4.4.2 works fine with MySQL 4.1.20 (this is what I have done now, so my sites are online, but I would prefer using PHP 5.1.x again).

    I tried compiling PHP 4.4.2 and 5.1.4 with these options:

    and without "--with-mysqli" but in both cases the problem persisted: PHP 4.4.2 connecting fine to MySQL, but PHP 5.1.4 not

    Any ideas?
    Thanks in advance

    Edit: ok, now the problem is fixed. What I did (if somebody ever needs it) was deleting the whole php directories before doing a recompile and reinstall of PHP 5.1.4 (very strange, usually it was not needed till now, when I upgraded PHP or MySQL, ie. I had not deleted the php directories when I had upgraded from PHP 4.4.2 to 5.1.4). Probably there were some old files left there, causing problems with MySQL 4.1.x connections, even after a recompile and reinstall. Finally, everything works ok now with PHP 5.1.4 and MySQL 4.1.x
    #1 nickg78, Jul 28, 2006
    Last edited: Jul 28, 2006

Share This Page