• Resolved pigsound

    (@pigsound)


    in order to secure the functionality of one plugin that requires php 5.3, i tried to change the php accordingly.
    my host provides instruction on how to do it:

    On our servers the following php versions are running:
    – PHP 4.4.9 [.php4]
    – PHP 5.2.17 [.php5]
    – PHP 5.3.6 [php53]

    with the respective suffixes the according php version is used as parser.
    to use a special php version for all files with .php suffix you can create a .htaccess files with the following content:

    # List of file suffixes to use with php5
    AddHandler php-fastcgi5 .php

    or

    # List of file suffixes to use with php4
    AddHandler php-fastcgi4 .php

    or

    # List of file suffixes to use with php3
    AddHandler php-fastcgi5.3 .php

    since there already exists a .htaccess file in my wordpress installation, i was not sure where to add these lines (the one for php 5). so in my first try i put it right before everything that already existed in the .htaccess file.
    this caused wordpress to show a blank page with the message “database connection failed”.
    then i put the lines right after everything that already was written in the .htacces file with the same result.

    does anybody have an idea what i can do to upgrade my php version? did i do it wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • All those php versions are end of life or no longer supported. Minimal php version is 5.6, https://php.net/supported-versions.php

    Thread Starter pigsound

    (@pigsound)

    thank you for that detail, according to it i changed the htaccess file to:

    AddHandler php-fastcgi5.6 .php .phtml .phps
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    again the database connection failed. what is wrong here?

    thank you for your help, hints and advice in advance!

    Barry

    (@barryhughes-1)

    If you enable WP_DEBUG (see here to learn how) do you see any additional error messages?

    Thread Starter pigsound

    (@pigsound)

    turning wp-debug mode on causes wordpress to show nothing more but the following message:

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the ladanroxy.com database.

    * Are you sure it exists?
    * Does the user xxxxxxx have permission to use the ladanroxy.com database?
    * On some systems the name of your database is prefixed with your username, so it would be like username_xxxxxx. Could that be the problem?

    If you don’t know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    since the wordpress site works as long as i don’t use the modified htaccess file, database, permission and prefix must be ok. very strange, at least to me… anybody?

    Barry

    (@barryhughes-1)

    That does sound strange. Might be worth connecting with your host and asking for their input.

    Thread Starter pigsound

    (@pigsound)

    problem solved:
    the database password has to be changed. first, i changed it in the database via myphp or cpanel, then i changed it in wp-config.php.
    then, i changed the htacces as follows:

    AddHandler php-fastcgi5.6 .php .phtml .phps
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    now the website runs just like before and php is upgraded to 5.6!
    ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘upgrading to php 5.3 – "database connection failed"’ is closed to new replies.