I am trying to install extension by command.
In server already configure the PHP CLI and I'm using this code :
shell_exec('php-cli '.$SitefilePath.' --package='.$packagePath.'');
I have upload the file:
https://raw.githubusercontent.com/akeeba/vagrant/master/vagrant/files/joomla/install-joomla-extension.php
In the CLI folder and pass path as SitefilePath into command.
but its not working.
I have checked with all option :
http://www.php-cli.com/php-cli-options.shtml
Let me know how to get this work.
All of these issues have been properly debugged in the install-joomla-extension.php script I wrote.
First, create a new plain text file and paste that code in it. Save it as install-joomla-extension.php in your Joomla! site's cli directory. The name is not important, the location (cli directory) is.
Now you can call it like this:
cd /path/to/site/cli php ./install-joomla-extension.php --package=/where/is/your/extension.zip
The script returns one of the following exit statuses:
Source: https://www.dionysopoulos.me/238-installing-joomla-extensions-from-the-command-line.html
Let me know if this works.
On Joomla 5, it can be quite easy. Use the cli/joomla.php interface with the respective extension installation command.
For instance, with an apache system under linux, do (possibly replace paths):
sudo runuser -u www-data -- php /var/www/joomla/cli/joomla.php \
extension:install --path /var/www/com_mycomponent.zip
Just make sure the file can be read by www-data.
For more useful commands of the interface, use the --help switch:
php /path/to/joomla/cli/joomla.php --help
or list the commands directly:
php /path/to/joomla/cli/joomla.php list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With