[[oktatas:web:cms:wordpress|< WordPress]] ====== WordPress - Kezdés composer-rel ====== * **Szerző:** Sallai András * Copyright (c) Sallai András, 2023 * Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]] * Web: https://szit.hu ===== Kezdés ===== ==== Interaktív ==== composer init ==== composer.json fájl ==== { "require": { "johnpbloch/wordpress": "*" } } composer install ==== Parancs ==== composer require johnpbloch/wordpress ===== Adatbázis ===== A WordPress MySQL vagy MariaDB adatbázissal tud dolgozni. Vegyünk fel egy felhasználót. Tegyük fel, hogy az adatbázisnév app01 és a felhasználónév is: grant all privileges on app01.* to app01@localhost identified by 'titok'; ===== Konfigurációs fájl ===== A wordpress könyvtárban készítsünk másolatot a wp-config-sample.php állományról: copy wp-config-sample.php wp-config.php ===== Beállítás ===== //... // ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'database_name_here' ); /** Database username */ define( 'DB_USER', 'username_here' ); /** Database password */ define( 'DB_PASSWORD', 'password_here' ); //... ===== Fejlesztői szerver ===== Futtatás: php -S localhost:8000 -r wordpress ===== Alkönyvtár ===== Ha alkönyvtárból futtatjuk, szükség lehet a wp-config.php fájl végére: define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/wp-content' ); define ('WP_CONTENT_URL', 'http://wpalkonyvtar.dev' . '/wp-content' ); ===== Linkek ===== * https://deliciousbrains.com/storing-wordpress-in-git/ (2023)