WordPress.org

Forums

[resolved] missing the MySQL extension (8 posts)

  1. macedonmike
    Member
    Posted 6 years ago #

    I am getting this message when running install.php

    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

    I believe I have the php-mysql extensions installed, I am running Ubuntu Hardy Heron. Any ideas?

  2. macedonmike
    Member
    Posted 6 years ago #

    I checked and I have php5-mysql installed, do I need something else?

  3. NC@WP
    Member
    Posted 6 years ago #

    To simply install an extension is not enough; PHP has to be configured to use it.

    Run phpinfo(); it will output information about all extensions currenly enabled.

  4. macedonmike
    Member
    Posted 6 years ago #

    Okay I ran phpinfo() from the command line and that is obviously not the way to do that. I'm going to go through the php docs and some tutorials and see if I can figure it out. If there are any good intros I'd appreciate a point in the right direction

  5. whooami
    Member
    Posted 6 years ago #

    Okay I ran phpinfo() from the command line and that is obviously not the way to do that.

    you can run phpinfo from the command line.

    php phpinfo

    its wiser and easier though to create a file named phpinfo.php, and put this in it:

    <?
    phpinfo();
    ?>

    put it in a web accessible area, and just open that file in your browser

  6. NC@WP
    Member
    Posted 6 years ago #

    whooami,

    you can run phpinfo from the command line.

    php phpinfo

    Generally, that would be a bad idea, as the command-line PHP interpreter may not be using the same php.ini the Apache module (or CGI/FastCGI executable) is using. Not so mention the fact that running php phpinfo will probably result in an error; you need to run either php -i or php -r 'phpinfo();'

    You other recommendation, however, is right on the money. :)

  7. whooami
    Member
    Posted 6 years ago #

    oh gee, i left off the -i switch.

    pardon me. I spose thats no more ambiguous than this though.

    Run phpinfo();

    Just sayin'.

  8. macedonmike
    Member
    Posted 6 years ago #

    Here is how to configure PHP in Apache:

    13. Setup your php.ini

    cp php.ini-dist /usr/local/lib/php.ini

    You may edit your .ini file to set PHP options. If you prefer having
    php.ini in another location, use --with-config-file-path=/some/path in
    step 10.

    If you instead choose php.ini-recommended, be certain to read the list
    of changes within, as they affect how PHP behaves.

    14. Edit your httpd.conf to load the PHP module. The path on the right hand
    side of the LoadModule statement must point to the path of the PHP
    module on your system. The make install from above may have already
    added this for you, but be sure to check.

    For PHP 4:

    LoadModule php4_module modules/libphp4.so

    For PHP 5:

    LoadModule php5_module modules/libphp5.so

    15. Tell Apache to parse certain extensions as PHP. For example, let's have
    Apache parse .php files as PHP. Instead of only using the Apache AddType
    directive, we want to avoid potentially dangerous uploads and created
    files such as exploit.php.jpg from being executed as PHP. Using this
    example, you could have any extension(s) parse as PHP by simply adding
    them. We'll add .phtml to demonstrate.

    <FilesMatch \.php$>
    SetHandler application/x-httpd-php
    </FilesMatch>

    Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
    .phtml files to be executed as PHP, but nothing else, we'd use this:

    <FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
    </FilesMatch>

    And to allow .phps files to be executed as PHP source files, add this:

    <FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
    </FilesMatch>

    16. Use your normal procedure for starting the Apache server, e.g.:

    /usr/local/apache2/bin/apachectl start

    - OR -

    service httpd restart

    The full documentation is available at:
    http://us3.php.net/manual/en/install.unix.apache2.php

    Thankyou for the help everyone

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.