Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

PHP Versions

by , Last updated on 2 months ago in Modifications and Requests - 8
I have what may be a silly question. When running Fusion v8 under PHP Version7 is it possible to run a script/scripts under PHP 5.6? In other words can you change PHP versions on the fly for a specific infusion? The reason I ask is that my Avatar Studio will not run under PHP Version7 but has been running just fine for years under all PHP versions prior to 7. Until I can figure out how to fix the errors I am getting I'd like to be able to use it.
Energy can neither be created nor destroyed; only transformed !
In short no, You need to try to identify problem areas and correct em to work on a higher version.
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Please read and comply with the Code of Conduct

(¯`·._.·(¯`°·._.·°º*[ Project Manager ]*º°·._.·°´¯)·._.·´¯)
Thanks Falk for your reply. I was 99.9% sure it would not work. I have identified the problem areas just can't solve them so far but I will eventually get it. Please mark this as solved/closed.
Energy can neither be created nor destroyed; only transformed !
Well it could work if the server has multiple php versions installed.
Take a look here, https://stackoverflow.com/questions/12561203/how-to-change-php-version-in-htaccess-in-server

You could add an htaccess file with AddHandler application/x-httpd-php56 .php in it and place it in the infusion folder of the infusion you want to run on an older php version.

Or if this infusion is very important, switch back the whole site to php v5.6(latest). A php-fusion v8 site runs ok on php 5.6.
In the mean time look at the error pages for depreciation notices and try to find solutions that are php v7 proof. If you fixed that go back to php v7
www.probemyip.com/probe-my-ip-80x15.png
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support community. Send PB for info.
I use the the Avatar Studio 2.3 with PHP 7.3.4. It works. What is the problem?
Grimloch has replied to this - 2 months ago
@Harlekin
That's very bizarre. I just switched my PHP version from 7.2 to 7.3 and it still won't work. Here is the error I'm getting:
[08-May-2019 08:02:14 America/Chicago] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/include/avatar_functions.php:14
Stack trace:
#0 /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/avatar_studio.php(50): loadAvaCats()
#1 {main}
 thrown in /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/include/avatar_functions.php on line 14

It does not like the [ ] operator. Here is the code line:
$avaCats[] = $file;

Any suggestions?
Energy can neither be created nor destroyed; only transformed !
RobiNN has replied to this - 2 months ago
OMG people Google still exists....


$avaCats = []; // or $avaCats = array();
$avaCats[] = $file;
PHP-Fusion Development Manager

Web Designer/Developer: GitHub
That's not really an answer; Google returns thousands of possibilities with a LOT of cryptic code that requires an intimate knowledge of php's inner workings. However, when I do this per your suggestion:
function loadAvaCats()
{
 $ignore = array('.', '..');
 $avaCats = "";
 if ($handle = opendir(AVATAR_FOLDER))
 {
 while (false !== ($file = readdir($handle)))
 {
 if(!in_array($file, $ignore) && !is_file(AVATAR_FOLDER . '/' . $file))
$avaCats = array();
 }
 }

 closedir($handle);
 return $avaCats;
 }

 return false;
}
 {

...it does nothing. But if I add $file like so:
function loadAvaCats()
{
 $ignore = array('.', '..');
 $avaCats = "";
 if ($handle = opendir(AVATAR_FOLDER))
 {
 while (false !== ($file = readdir($handle)))
 {
 if(!in_array($file, $ignore) && !is_file(AVATAR_FOLDER . '/' . $file))
$avaCats = array($file);
 }
 }

 closedir($handle);
 return $avaCats;
 }

 return false;
}
 {

...it almost works but I get only 1 directory and 1 avatar image.
www.whisperwillow.com/my_panels/ava_studio.jpg
Energy can neither be created nor destroyed; only transformed !
RobiNN has replied to this - 2 months ago
Here is issue: change $avaCats = ""; to $avaCats = [];
PHP-Fusion Development Manager

Web Designer/Developer: GitHub
No dice... does nothing.
Energy can neither be created nor destroyed; only transformed !
Harlekin has replied to this - 2 months ago
You find the avatar_functions.php and avatar_studio.php in the attachment that i use.
Harlekin attached the following file:
avatar_studio.rar [3.24kB / 26 Downloads]

Harlekin wrote:

@Harlekin - I use the the Avatar Studio 2.3 with PHP 7.3.4. It works. What is the problem?

You know it would have been nice when you made this post/statement if you had told me that it was YOUR modified version of my infusion that was working fine for you! At any rate I d/l'ed the RAR file you attached in the previous post and have mine working fine also. Thanks !
Energy can neither be created nor destroyed; only transformed !
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: Falk, Wanabo, Grimloch, Harlekin, RobiNN