WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Apache 2.4, MariaDB, PHP7 and Wordpress  (Read 937 times)

Offline parky_dw

  • WikiUser
  • *
  • Posts: 31
Apache 2.4, MariaDB, PHP7 and Wordpress
« on: December 19, 2017, 04:36:02 AM »
I have a Tiny Core 8.2.1 installation running Apache 2.4.  I decided to add a Wordpress based website and so needed php and MariaDB installed as well.

The steps:
1) Install MariaDB
2) Configure Apache for a new virtual host and check it worked.
3) Install php.
    I was a little slow here as the app browser shows apache2-mod-php5.tcz but nothing for apache 2.4.  Eventually the penny dropped and I installed php7-mod.tcz and php-ext.tcz.
4) Back to Apache conf file to get the php module loaded and the php handler installed.
5) Install Wordpress (latest.zip off their website)
6) Fire up the browser.....

To cut a long story short:
The Wordpress site returned:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

I discovered in the sample ini file for PHP7 the line:
extension_dir = "/usr/local/lib/php/extensions/no-debug-zts-20151012"

The actual extension directory is: "/usr/local/lib/php/extensions/no-debug-zts-20160303"

Having corrected that it didn't get me much further forward.

The Apache error_log file included many lines like:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20160303/curl.so' - libcurl.so.4: cannot open shared object file: No such file or directory in Unknown on line 0

and for: gd.so, gmp.so, intl.so, ldap.so, mysqli.so, pdo_mysql.so.....and so on.

The PHP warning wording above is a bit confusing. Reading left to right the error is:
 - a dynamic library can't be loaded
 - the file on the left requires the one on the right.

i.e. /usr/.../..zts-20160303/curl.so is unable to load libcurl.so.4

I knew the mysql library was there.  After a little more thought I added the line:
to the file /etc/ld.so.conf
and then ran
sudo ldconfig -v
I then restarted apache and wordpress burst into life.

- the php sample ini file has an error in the extensions path.
- Should I need to set the library load path for mysql or should that have been set as part of the build and/or app installation?

« Last Edit: December 19, 2017, 05:05:26 AM by parky_dw »

Offline andyj

  • Hero Member
  • *****
  • Posts: 714
Re: Apache 2.4, MariaDB, PHP7 and Wordpress
« Reply #1 on: December 19, 2017, 05:42:04 AM »
I haven't looked at the sample ini file in a while. Thanks for pointing out the extension path error. I'll also set the extensions to not load by default. I made it by copying from my build environment, and I load them all for testing. Because extensions are optional their dependencies are not required in the PHP .dep files. I've tried to list the dependencies for each extension in the sample ini file. Sometimes extension names change, so I'll check that too the next time PHP is updated. Since nobody has commented one way or the other, it will probably be version 7.2.1.