• Hi

    I have a Windows box:

    Apache 2.4 (runs perfect, have other sites on it)
    PHP7 (as per your download instructions), also working with the info script
    MySQL (installed and working)
    Wordpress in the directory

    Run https://domain.com/index.php i get the setup, however when it then tries to connect to the database i get a 500 error and the below in the Apache error log

    Fatal error: Uncaught Error: Call to undefined function mysql_connect()

    This appears to be as PHP7 no longer has anyway of connecting to a SQL database in it, so why are you telling us to use it?

    Whats the fix on a Windows server?

    Ive been at this 6 hours, right at your “Famous 5-Minute Installation” which i am guessing was a joke based on the fact you recommended PHP7.2 which has no way of connecting to ANY SQL database!

    What do i change / add to PHP to get this to work?

    ManyThanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    It appears you’re missing the php-mysql extensions necessary to talk to MySQL.

    https://php.net/manual/it/install.windows.extensions.php

    Thread Starter Ashley

    (@sfxgroup)

    Hi Steve

    I’ll look in to this in about 30 mins. My point of the post was WordPress says load PHP7.2, there is no mention of “when you use PHP 7.2 we are using commands it no longer supports so it wont work, go fix it yourself, not our problem”.

    Dont you agree?

    Theirs a whole slew of information on the internet about this (everyone else bumping in to the same issue). Clearly they should not be advising PHP 7.2 as there is no connector in that build that works with WordPress…

    • This reply was modified 6 years, 3 months ago by Ashley.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    No. If you’re building your own server, you have to set up the environment correctly. That’s outside of the “just a few clicks to install” part of WP. WP is your car — you need a street on which to drive it.

    On Linux, the PHP library is usually called php-mysqlnd. I’m not sure how that maps onto Windows.

    Thread Starter Ashley

    (@sfxgroup)

    UPDATE

    Ive managed to get this working (thanks Steve), below are what i changed from a vanilla install of PHP7

    – Make sure you have a php.ini file (which you will need to get ANY PHP scripts working, so the assumption is that works but you get the SQL connection issue above).
    – Open php.ini and change / add the below (this is for Windows with Apache)
    : extension_dir = “C:\Program Files\INTERNET\php\ext” [this is my example on my server]
    : extension=mysqli
    : extension=pdo_mysql

    The above has fixed the first setup issue of the SQL error listed in the subject title. I have more issues with the database now but thats not for this thread.

    The issue appears to be most of the fixes found on the internet are for linux and not Windows.

    Thread Starter Ashley

    (@sfxgroup)

    Hi Steve

    I would like to professionally disagree with you here, and site what happened with washing machines in North America (USA and Canada).

    All washing machines sold in North America (a few years ago) that were made outside of North America had “quick connect” hoses, and states “take hope and have running in 10 minutes” (idental to the “Famous 5-Minute Installation”). However these hoses had 25mm connections, the WORLD STANDARD for “large diameter” threads and were metric, North America uses imperial 1 inch (25.4mm)…. there was a back lash, non of the machines worked without some major adapter (the home owner didnt have).

    Not only were the machines not “take home and have running in 10 minutes” they were never going to work as not compatible with any house water supply outlet in North America (abit like WordPress recommending a version of PHP that doesnt have a required connection method USED IN WORDPRESS.

    Using your logic thats the home owners issue for now having a non standard house? or MAY BE as i put forward, they (the manufacture) should have put a warning on the machine (as they then had to) “please make sure you have imperial 1 inch to metric 25mm water adapters (which later at least Bosch did).

    What i am saying here is clearly WordPress is using a command NOT IN PHP7, so a warning should be carried on there prerequisites page “please make sure you enable MySQL functionality in your install of PHP7 as its been removed by factory …..” with possibly some link to show how its done.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    PHP is composed of many files and libraries. MySQL support has not “been removed by the factory”. It would be nice to say “here’s the command to set up PHP correctly”, but it would be different for each Linux distribution and (god help us) version of Windows.

    As you might guess, I’m not a fan of Windows servers. ??

    Anyhow, glad you’ve made it past this hurdle.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal error: Uncaught Error: Call to undefined function mysql_connect()’ is closed to new replies.