|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
Greetings . . . The last step in my upgrade plan was switch out the trailing PHP version we have been running for years. I got word from one user of a strange error so I checked the server logs: 20220313T160723: www.inliners.org/ubbthreads/ubbthreads.php PHP Fatal error: Uncaught Error: Call to undefined function ctype_alnum() in ./public_html/inliners/ubbthreads/libs/phpmailer/class.phpmailer.php:1461 Stack trace: #0 ./public_html/inliners/ubbthreads/libs/phpmailer/class.phpmailer.php(1502): PHPMailer::isShellSafe('webmaster@inlin...') #1 ./public_html/inliners/ubbthreads/libs/phpmailer/class.phpmailer.ph I went to the control panel and tried to send an email from the Webmaster account. Fails every time. Could the upgrade from PHP 5.5 to PHP 7.4 be the culprit? Should I fall back to the old version? Or is there perhaps a control panel setting that needs to be tweaked? regards, Keith
|
|
|
|
Joined: Jun 2006
Posts: 16,252 Likes: 112
|
Joined: Jun 2006
Posts: 16,252 Likes: 112 |
What version of UBB.threads are you running? What version of PHP are you running?
No versions of UBB.threads are capable of running on PHP8 PHP7 compatibility comes in at UBB.threads v7.7 UBB.threads v7.7+ requires PHP 5.4+
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
Thanks for the quick reply Gizmo. We are running version 7.7.5. We had been running PHP 5.4 for years. I just switched to php 7.4 today.
|
|
|
|
Joined: Jun 2006
Posts: 16,252 Likes: 112
|
Joined: Jun 2006
Posts: 16,252 Likes: 112 |
During your upgrade did you replace all of the libs/ files?
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
That was the first thing I checked. Everything in the /libs/phpmailer directory was replaced with new versions.
|
|
|
|
Joined: Jun 2006
Posts: 16,252 Likes: 112
|
Joined: Jun 2006
Posts: 16,252 Likes: 112 |
It looks like the default PHP extension ctype-alnum isn't available for your PHP version (is it disabled for some reason?) could you try another PHP version on the machine to see if it's available?
|
|
|
|
Joined: Jun 2006
Posts: 16,252 Likes: 112
|
Joined: Jun 2006
Posts: 16,252 Likes: 112 |
I wrote a quick tool to check if this function is available to the system with your server configuration. ctype.php <?php
if(function_exists("ctype_alnum")) {
echo("The PHP Function \"ctype_alnum\" was found on this system.");
} else {
echo("The PHP Function \"ctype_alnum\" was <b>NOT</b> found on this system.");
}
echo("\n<br><br>\n");
echo("The \"<a href=\"https://www.php.net/manual/en/function.ctype-alnum.php\" target=\"_blank\">ctype_alnum</a>\" function should be installed by default on PHP 4.0.4+, PHP5, PHP7, PHP8. If this function has not been located on your machine please install it or choose a different available PHP version.");
?> The ctype_alnum function is provided in all builds of PHP after PHP4.0.4; if it is missing on your system it'd likely be disabled through the php.ini on the server. We've tested PHP7.4 here on UBBCentral on UBB.threads v7.5.5 and are able to submit mail messages (email thread is the general test) with no issues.
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
The PHP Function "ctype_alnum" was NOT found on this system.
The "ctype_alnum" function should be installed by default on PHP 4.0.4+, PHP5, PHP7, PHP8. If this function has not been located on your machine please install it or choose a different available PHP version.
Thanks for the code. Any idea why it is not included on the system or somehow supressed by .ini setting? I searched the php.ini for ctype and/or alnum - I find nothing.
PHP Info page in my server control panel reports specifics 7.4.10 with Sep 9 2020 06:35:57 build date.
|
|
|
|
Joined: Jun 2006
Posts: 16,252 Likes: 112
|
Joined: Jun 2006
Posts: 16,252 Likes: 112 |
Thanks for the code. Any idea why it is not included on the system or somehow supressed by .ini setting? I searched the php.ini for ctype and/or alnum - I find nothing. Unless the special case with FreeBSD, or another distribution, I'd ask your webhost. Generally this is a standard function provided with PHP, but your host will be the concrete voice of reason as it's generally their configuration at play. Your PHP.ini might not have a disabled line, but in a shared environment the system php.ini will have its settings, and then user php.ini files can overwrite them (if allowed). UBB.threads is a web script, with numerous other script libraries; we assume a fully functional web server with default modules and little more; the UBB.threads Test Script attempts to locate these items and alert you to configuration issues, but these issues need to generally be checked by your web host. The install guides all indicate that we simply require common PHP functions to operate.
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
Thanks! I will take it up with the support folks in our hosting site.
Curiously the module is mentioned just once in the PHP Info page: Module Authors ctype Hartmut Holzgraefe
but never again . . .
I will report back with resolution specifics (to the extent they share) so as to complete this thread.
|
|
|
|
Joined: Apr 2004
Posts: 1,944 Likes: 144
|
Joined: Apr 2004
Posts: 1,944 Likes: 144 |
ctype was was added in PHPMailer 5. UBBT 7.5.x and older used PHPMailer 2 and has several known security issues which are corrected in newer versions of PHPMailer. UBBT 7.6 and 7.7 use PHPMailer 5. The ctype extension provides a set of functions that are used to verify whether the characters in a string are of the correct type. The extension is enabled by default if you’re running PHP 4.2 or above. The ctype functions check a string value to see if the characters are within a given range or that every character is of the appropriate type. For example, you can use these functions to see if a string contains only uppercase characters, or if it’s numeric, or if it consists of hex characters, or one of the other dozen or so options available. ctype functions are always preferred over regular expressions (regex), and even to some equivalent "str_*" and "is_*" functions. This is because of the fact that ctype uses a native C library and thus processes significantly faster. further reading here: https://www.sitepoint.com/an-introduction-to-ctype-functions/
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
Our hosting provider uses Debian. Curiously, outbound emails were not impacted by this change until PHP was upgraded. There's another wrinkle in this somewhere. Inliners has been live with UBBT 7.7.5 since 21-Feb using the old PHP version. Switched to PHP 7.4 today and boom.
|
|
|
|
Joined: Nov 2021
Posts: 28 Likes: 1
Newbie
|
Newbie
Joined: Nov 2021
Posts: 28 Likes: 1 |
The engineers supporting our platform had to manually deploy it. These links helped to quickly orient the support engineer on what was missing. They have indicated that future updates to PHP in our environment will now include this module. Thanks again for the quick turn on issue resolution.
|
|
|
|
|