Change php version command line

Hi,

Is it possible to change php version for a single domain using commando line?

Thanks
joao

Hello–

Here is info on how to create one-liners: How to: Create One-Line Commands Using the InterWorx CLI Utility — InterWorx documentation

Here is info on how to use the CLI tool (which is used to create one liners): Using the InterWorx CLI Utility — InterWorx documentation

You can change the PHP version for all of the domains under an account with this, (replacing {master domain} and {php version} with the correlating info):

nodeworx -u -n -c Siteworx -a changePhpVersion --master_domain  {master domain} --php_version /opt/remi/{php version}

So for example, to change all of the domains under an account with example.com as the master domain to PHP 7.2:

nodeworx -u -n -c Siteworx -a changePhpVersion --master_domain  example.com --php_version /opt/remi/php72

To change the PHP version of a specific domain under a SiteWorx account, you would use the following (replacing {master domain}, {php version}, and {domain} with the corresponding info:

siteworx -u --login_domain {master domain} -n -c DomainsPhp -a edit --php_version {php version} --domain {domain}

Example, changing the PHP version for a secondary domain called second.com, under a a SiteWorx account with the master domain of example.com, to the system php version:

siteworx -u --login_domain example.com -n -c DomainsPhp -a edit --php_version system-php --domain second.com

And example changing the same domain to PHP 7.2:

siteworx -u --login_domain example.com -n -c DomainsPhp -a edit --php_version /opt/remi/php72 --domain second.com

Thanks,
Jenna, Friendly Neighborhood InterWorx Support Manager