Yunohost install command replacing php5 to php7.0 in script files


#1

I tried to create a custom app which uses php5 (because of mysql_connect command instead of mysqli_connect). When tried to install it, the moment i click on install, the githhub repo is being copied into /var/cache/from_file folder and when i saw the contents immediately, i found “php5” is replaced with “php7.0” in conf, script folder files and thus it is giving an error in my installation.

I was trying to reload php5.6-fpm service and because of above behaviour, it is trying to reload php7.0.6-fpm service.

Is there any workaround for this?

I cannot change the code commands as it is bought from other source with a license.

Thanks and Regards,
Kumar.


#2

AH, I was wondering why someone didn’t come talk about this sooner :wink:

I’m not sure to know if using php5 in ~2019 is a good idea but so be it. There is indeed a mechanism in Yunohost automatically replacing php5 by php7.0 in scripts, introduced during the Jessie->Stretch transition because otherwise we would have had to do this manually in something like 100 differents apps and that was clearly a no-go for various reasons.

From a pragmatic point of view, I think you can try fooling the mechanism by not writing explictly php5. So something like :

PHP5=$(echo "php 5" | tr -d ' ')
systemctl reload ${PHP5}-fpm

#3

Thank you. It worked.