I developed a WordPress site for running on IIS with PHP FastCGI, that works.
I found that website is so slow, so tried to test it under Apache.
Now I have an installed WordPress site, IIS, Apache and 2 different php installation.
1 PHP is Non-Thread-Safe PHP (V7.4.9) that will be called by IIS FastCGI module and works correctly.
Another is ThreadSafe PHP (V7.4.9) that will be called from Apache and works but not for mysql.
When I execute code under Apache (localhost:81) it produces below error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\Website\wp-includes\wp-db.php:1670
Stack trace:
#0 D:\Website\wp-includes\wp-db.php(632): wpdb->db_connect()
#1 D:\Website\wp-includes\load.php(476): wpdb->__construct('DB_USER_VAL', 'DB_PASS_VAL', 'DB_NAME_VAL', '127.0.0.1')
#2 D:\Websites\Navand\wp-settings.php(124): require_wp_db()
#3 D:\Website\wp-config.php(92): require_once('D:\\Website...')
#4 D:\Website\wp-load.php(37): require_once('D:\\Website...')
#5 D:\Website\wp-blog-header.php(13): require_once('D:\\Website...')
#6 D:\Website\index.php(17): require('D:\\Website...')
#7 {main} thrown in D:\Website\wp-includes\wp-db.php on line 1670
Note:
- Apache PHP works correctly when calling phpinfo()
- extension_dir has been set for both php installations
- both php_mysql and pdo_mysql are enabled for both php installation
- both php.ini files are same (checked by WinMerge)
Why calling same mysql functions on Apache and TS-PHP generates error, but works correctly on IIS? and how can I resolve this problem (as I can not change WordPress source)