phcli is a cli tool you can use to handle various aspects of the your web / magentohotel. At the time of writing the following features are available
To use phcli you need to log in to your web or magentohotel using ssh. When logged in type phcli and press enter. Then navigate the menu by pressing the number next to the wanted action.
Changes the php version in cli which is the version you use when you run commands via ssh.
Changes the php version in fpm which is the version that the application will be run entering the site from a web browser or any http client.
Lets you add or remove domains to your webhotel. Adding domains here will point them to the document root the same way as the hotel's main domain.
Adding domains here will redirect them to the main domain for the web/magentohotel with status code 301 (permanent)
Edit documentroot lets you manage from which folder or subfolder in public_html you want to serve your content. In Magento 2 you would often want to secure your application setting the Document Root to public_html/pub
Lets you change php's return path for mails sent via your web/magentohotel. Normally you set the return path directly in your application or code, however sometimes you would want to set it directly in php.
Previously we had a seperate CLI app for restoring backups. We now implemented this directly in phcli to bring you a simpler, and more effecient way of restoring a backup. You will need the following information to restore your backup.
This option will be available when using varnish in front of a Magento 2. If you use varnish and Magento 2 and this option is not available please contact Powerhosting support at support@powerhosting.dk
Sometimes you would want to reset all your files in public_html to the correct owner and permissions. This command will do that for you.
In Magento 2 you can either set your store mappings in index.php or even better in .htaccess. The downside of this, however is that it will be overwritten in upgrades. Therefore we have implemented an upgrade-proof way of setting multistore mappings. The map will be merged with existing web server configuration.
Chose whether you want your domain to be prefixed with www (and without will be redirected to www) or not.
You can set the default major composer version, either 1 or 2.
phcli version 0.8.0 added support for arguments. For now it only adds support for the following actions:
You can use multiple arguments per command run. Run phcli --help
to see syntax.
Using --set-server-aliases
will result in an override of the existing server aliases. To add new server aliases without removing the existing ones please use in combination with --get-server-aliases
.
To remove all server aliases run: phcli --set-server-aliases ""