Changes since 1.0.1:
- Correctly handle PHP versions when calling
wp
CLI commands
Changes since 1.0.1:
wp
CLI commandsHello,
I have installed Wp Workbench with dnf install wbm-virtualmin-wp-workbench
. I have Virtualmin Pro. But I do not see it in Manage Web Apps page when selecting a virtual server with WordPress⊠I cleared the Brave cache and Virtualmin cache.
I see the plugin activated in Features and Plugins, but any of my domains are using it (there is 0 in this page).
Do I need to do anything for WP Workbench to recognize my WordPress installations? I installed WordPress manually on the server in every domain.
Thank you very much.
Best regards,
Ivan
You donât see it in Manage Wordpress? You will need to use the script install of wordpress I would think.
No, I do not have that page. I only see:
Yes, I think this is the problem. I need to install WordPress with Virtualmin script install.
@Ilia Is there any way to use WP Workbench with a manual installation of WordPress? Thanks!
In cpanels they have a scan for wordpress, maybe something like that to allow for wordpress management.
Ah, I see what you meanâyes, we do have an option for this!
You can use the Virtualmin CLI for this purpose:
virtualmin detect-scripts --domain domain.tld --dir /home/domain/public_html/wordpress
@ivanbg However, bewareâthereâs currently a tiny bug that will also import ClassicPress clone as WordPress installations. Itâs not a big deal, thoughâyou can manually find and delete the unwanted entry in the /etc/webmin/virtual-server/scriptlog
directory.
Just donât use Virtualmin to remove/uninstall it, or it will delete your actual WordPress installation.
@Jamie, any thoughts on addressing this? I think we need to run a more thorough check to distinguish between WordPress and ClassicPressâI will take a look.
Thank you very much!
Great news and a wonderful plugin.
One more reason to continue with Virtualmin Pro
You should promote this feature more. I think it is a game changer for many people in the WordPress ecosystem.
Thanks again!
I follow your recommendation, and all itâs ok. The menu appears in
Manage WordPress, but under WP WorkBench I see the following error:
Perl : Failed to parse JSON output from WP-CLI command : malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/libexec/webmin/web-lib-funcs.pl line 13005.
PHP : Failed running `/bin/php83 /home/domain/public_html//wp-cli.phar --path=/home/domain/public_html/` command. See the log file at /home/domain/logs/wp_cli_log
In the logs I see:
cat /home/domain/logs/wp_cli_log
Could not open input file: /home/domain/public_html//wp-cli.phar
Could not open input file: /home/domain/public_html//wp-cli.phar
Update1: In the logs (The blog is in Spanish), I see:
malformed UTF-8 character in JSON string, at character offset 2142 (before "\x{ed}a de Egipto. I...") at /usr/libexec/webmin/web-lib-funcs.pl line 13005.
Update2: I tried the installation in some other blog and the problem is the same.
Perl : Failed to parse JSON output from WP-CLI command : malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/libexec/webmin/web-lib-funcs.pl line 13005.
PHP : Failed running `/bin/php83 /home/domain2/public_html/wordpress/wp-cli.phar --path=/home/domain2/public_html/wordpress` command. See the log file at /home/domain2/logs/wp_cli_log
I have WP CLI installed in the server, and works perfect.
Any idea? Thanks!
What does log /home/domain2/logs/wp_cli_log
say?
Only This:
Could not open input file: /home/domain2/public_html/wordpress/wp-cli.phar
Could not open input file: /home/domain2/public_html/wordpress/wp-cli.phar
I downloaded wp-cli.phar to this path. The PHP error disappeared, but not the perl error:
malformed UTF-8 character in JSON string, at character offset 2142 (before "\x{ed}a de Egipto. I...") at /usr/libexec/webmin/web-lib-funcs.pl line 13005.
Find the solution:
I download in /home/dominio/public_html the archive wp-cli.phar with:
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Change permission (executable) and ownership (root to virtual server user) and all works now.
Before, I hadnât changed the file owner from root to the server user.
Is it necessary to have the WP-CLI file wp-cli.phar in the root directory of each WordPress installation in order to WP Workbench to works?
Also, I have installed WP-Cli in my home user directory: /usr/local/bin/wp with:
mv wp-cli.phar /usr/local/bin/wp
chmod +x /usr/local/bin/wp
For security, I put in /public_html/.htaccess:
<Files "wp-cli.phar">
Order Deny,Allow
Deny from all
</Files>
And change permissions to 644.
I didnât even know that ClassicPress was a thing! Is there a way we can differentiate it from regular WordPress?
No, actually, thatâs discouraged. Weâll update the WordPress installer in Virtualmin to place it in the domain home at ~/bin/wp
, and you should move it there rather than leaving it in the document root.
This also prevents checksum verification issues with ./wp core verify-checksums
command, which we plan to implement soon in the WP Workbench plugin.
Yes quite easily, the PR is here:
I didnât know either, a most pointless software.
I wonât use wordpress that has millions of dollars spent in r and d
Thanks again!
I move wp-cli.phar to ~/bin/wp in domain home, and all works perfect.
Thanks for the feedback!
And, I have also updated the Virtualmin WordPress and ClassicPress installers to place WP-CLI in the ~/bin
directory.
Sounds like your getting a bit more indie and lossing the microsoft faith
I am also facing:
âPerl : Failed to parse JSON output from WP-CLI command : malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before â(end of string)â) at /usr/share/webmin/web-lib-funcs.pl line 13005.
PHP : Failed running /bin/php8.2 /home/domain/bin/wp --path=/home/domain/public_html
command. See the log file at /home/domain/logs/wp_cli_logâ
and
is empty.
wp-cli.phar is placed in ~/bin/wp and permissions set to be executable by owner and group. Both the folder and .phar file owned by the virtualmin hostâs user.
You have to go to home/your_user_server/bin and do the following (change your_user_server and your_group_server):
#Download wp-cli.phar
sudo curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
#move wp-cli.phar to wp
sudo mv wp-cli.phar /home/your_user_server/bin/wp
#make the file executable
sudo chmod +x wp
#Change user and group from your virtual server
sudo chown your_user_server:your_group_server wp
Thatâs it.