Coder Social home page Coder Social logo

Comments (4)

rabollin avatar rabollin commented on June 12, 2024

Currently issue is being investigated, there are some challenges with user permissions in accessing wp-cli.

from wordpress-linux-appservice.

ZubaeyrMSFT avatar ZubaeyrMSFT commented on June 12, 2024

@kubami

If you are running interactively via WebSSH, then you need to first update the wp-config.php file with database connection details. The reason is that database connection details are wired into wp-config.php file from the Application Settings and those are accessible only by the main thread that starts the container.

Look for this block of code in wp-config.php file

$connectstr_dbhost = getenv('DATABASE_HOST');                                                                
$connectstr_dbname = getenv('DATABASE_NAME');                                                                
$connectstr_dbusername = getenv('DATABASE_USERNAME');                                                        
$connectstr_dbpassword = getenv('DATABASE_PASSWORD');

Comment it out and add a new block with actual database connection details.

//$connectstr_dbhost = getenv('DATABASE_HOST');                                                                
//$connectstr_dbname = getenv('DATABASE_NAME');                                                                
//$connectstr_dbusername = getenv('DATABASE_USERNAME');                                                        
//$connectstr_dbpassword = getenv('DATABASE_PASSWORD');
 
$connectstr_dbhost = 'servername.mysql.database.azure.com';                                                    
$connectstr_dbname = 'database_name';                                                              
$connectstr_dbusername = 'db_username';                                                        
$connectstr_dbpassword = 'db_password';

Now try to run the below sample wp-cli commands from WebSSH console.

wp help --path=/home/site/wwwroot --allow-root
wp plugin list --path=/home/site/wwwroot --allow-root 

Note: You can retrieve database connection details from your App Service dashboard in Azure Portal.
(Configuration -> Application Settings -> Advanced edit)

from wordpress-linux-appservice.

rabollin avatar rabollin commented on June 12, 2024

@kubami - Can you confirm if your issue is resolved and can close this GH issue.

from wordpress-linux-appservice.

ZubaeyrMSFT avatar ZubaeyrMSFT commented on June 12, 2024

@kubami
WP-CLI is now fully enabled in production. You can now access and use it from SSH console of your SCM site.

Please refer to the following document for more details:
https://github.com/Azure/wordpress-linux-appservice/blob/main/WordPress/how_to_use_wpcli_tool.md

from wordpress-linux-appservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.