The Unreal Admins Page - Forums

The Unreal Admins Page - Forums (https://unrealadmin.org/forums/index.php)
-   General Chat (https://unrealadmin.org/forums/forumdisplay.php?f=174)
-   -   php7 (https://unrealadmin.org/forums/showthread.php?t=32025)

NightWing 25th November, 2017 08:27 PM

php7
 
i dont know all too much about php and mysql other than how to get a forum up and running, but I recently upgrading my forum to php7 which i guess makes it so u can no longer use mysql, u have to use mysqli (and a few other choices). The UTstats config.php still uses regular mysql by default, so is there a work around or will i have to reset my forum back/wait for a new version of utstats?

SoNY_scarface 20th December, 2017 12:50 AM

Best to use php5 NW

NightWing 9th January, 2018 10:08 AM

Unfortunately it was not my decision to upgrade to php 7, it was the company which we host our forums from, however theyve always been great with customer support and after a few messages they gave me a way to fix this issue. So for those of u who have this same issue they made this post for us: https://forums.nfoservers.com/viewto...p?f=19&t=14767

---------------------------------------------------------------------------------
In case the link ever goes down, it says:

If you're receiving the following error:


"Uncaught Error: Call to undefined function mysql_connect() in /usr/www/identifier/public/forums/functions/db.php:324"


...this is due to the deprecated mysql extension no longer being included, breaking all "mysql_" functions. Ideally, you would want to switch to one of the newer extensions, like mysqli or PDO, but the old functionality can be corrected with a shim that recreates the functions.

Download the shim here: https://raw.githubusercontent.com/ds.../lib/mysql.php
Upload the mysql.php file to your webhosting. Place it in the includes folder for your website, or a directory where typical config files can be found, if available
Locate a common file that is that is included everywhere in your software. Often this file is called "config.php" or "Settings.php" or similar. Edit that file to add this before other PHP statements:


"include_once('./mysql.php');"

This assumes the shim is in the same directory as the config file. If it's one directory up, you'll use '../mysql.php' and if it's one directory down, you'll use './folder_name/mysql.php'.
If you do not have a common config file, the line above will need to be included in all files using MySQL.
--------------------------------------------------

The link to the shim doesnt actually bring u to a download, u just copy and paste the coding into a blank file and call it "mysql.php"

NightWing 9th January, 2018 11:38 AM

this was enough to get information to show and to remove any errors, but the importer isnt working, just shows this and then stops:

Connecting to server: *IP: Port*
Connected, now logging in...
Logged in!
Setting passive mode

Ive tried turning passive mode to false, but it still doesnt go any further, that last message just changes so that u know its not passive mode. Ill keep working on it.

NightWing 11th January, 2018 08:11 AM

so it appears to be getting to the files, its just not bringing them home. This happens for both "sockets" and "pure" ftp type's, but "php" ftp type actually manages to import the files if they are on the web server (so u can still manually import your stats), however u will see an error of "Unable to connect to server: No FTP support in this php build!" when it talks about trying to get the files automatically from the server. Idk what thats all about cause after creating an info.php script i can tell my web server does indeed have ftp enabled.

Obviously if no one is sure about my questions dont irritate yourself trying to figure it out if u dont want to, im mainly documenting as i go for those of us that got screwed and were forced to upgrade to php 7

{SoP}axewound 12th January, 2018 02:52 PM

PHP 7 doesn't support the mysql extension anymore. The database connectivity for UT Stats will need to be ported to mysqli or PDO.

SoNY_scarface 12th January, 2018 10:56 PM

The simple solution would be to switch to paid hosting with PHP selector.

NightWing 13th January, 2018 03:58 AM

ya i know, im just hoping to find a work around. It sounds like the shim was supposed to b just that, just not working to the extent i was hoping for


All times are GMT +1. The time now is 09:54 AM.

 


All pages are copyright The Unreal Admins Page.
You may not copy any pages without our express permission.