Previous Thread
Next Thread
Print Thread
Hop To
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
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,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
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+


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
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,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
During your upgrade did you replace all of the libs/ files?


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
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,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
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?


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I wrote a quick tool to check if this function is available to the system with your server configuration.

ctype.php
Code
<?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.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
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: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Is your forum running on FreeBSD?
On FreeBSD, this library is NOT included automatically. It must be manually installed. This can be done with the following command:
Code
pkg install php70-ctype

source:
https://www.php.net/manual/en/ctype.installation.php

further reading here:
https://www.php.net/manual/en/intro.ctype.php
and here:
https://www.php.net/manual/en/book.ctype.php

in your forum's PHP Info page, you should see under ther ctype section,
Code
ctype functions 	enabled


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Originally Posted by InlinersAdmin
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.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
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,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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/


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2021
Posts: 28
Likes: 1
I
Newbie
Newbie
I Offline
Joined: Nov 2021
Posts: 28
Likes: 1
Originally Posted by isaac
Is your forum running on FreeBSD?
On FreeBSD, this library is NOT included automatically. It must be manually installed. This can be done with the following command:
Code
pkg install php70-ctype

source:
https://www.php.net/manual/en/ctype.installation.php

further reading here:
https://www.php.net/manual/en/intro.ctype.php
and here:
https://www.php.net/manual/en/book.ctype.php

in your forum's PHP Info page, you should see under ther ctype section,
Code
ctype functions 	enabled

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
I
Newbie
Newbie
I Offline
Joined: Nov 2021
Posts: 28
Likes: 1
Originally Posted by isaac
Is your forum running on FreeBSD?
On FreeBSD, this library is NOT included automatically. It must be manually installed. This can be done with the following command:
Code
pkg install php70-ctype

source:
https://www.php.net/manual/en/ctype.installation.php

further reading here:
https://www.php.net/manual/en/intro.ctype.php
and here:
https://www.php.net/manual/en/book.ctype.php

in your forum's PHP Info page, you should see under ther ctype section,
Code
ctype functions 	enabled

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.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Nightcrawler), 602 guests, and 132 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)