
Wordpress fragt mich nach FTP-Anmeldeinformationen, wenn ich versuche, Plugins zu löschen oder zu installieren. Ich weiß, dass es mit Berechtigungen zu tun hat, aber ich konnte es nicht herausfinden. Ich habe einen Linux-Systembenutzer XYZ und Apache2 läuft als www-data. Das funktioniert:
sudo chown www-data:www-data -R /path/to/wordpress
sudo chmod 700 -R /path/to/wordpress
Aber es ist unsicher. Meine ursprünglich geplante Konfiguration war:
sudo chown XYZ:www-data -R /path/to/wordpress
sudo chmmod 750 -R /path/to/wordpress
sudo chmod 770 -R /path/to/wordpress/wp-content
Laut der WordPress-Dokumentation ist wp-content der einzige Ordner, auf den der Webserver Schreibzugriff haben sollte. Er enthält die Ordner „Plugins“ und „Themes“.
Aber es funktioniert nicht. Ich habe mehrere Stunden damit verbracht, online zu recherchieren, aber nichts hat bisher geholfen und ich weiß nicht mehr, was ich versuchen soll. Welche Berechtigungen sind erforderlich, um automatische Updates und Plugin-Installationen zu ermöglichen, ohne dem Webserver Schreibzugriff auf alles zu gewähren?
edit: Aus irgendeinem Grund funktioniert Folgendes nicht:
sudo chown XYZ:www-data -R /path/to/wordpress
sudo chmod 770 -R /path/to/wordpress
Ich dachte, es wäre identisch mit der ersten Variante oben, die WWW-Daten Schreibzugriff auf alles gibt. Aber das funktioniert nicht.
Das ist meine wp-config:
<?php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'XXX' );
/** MySQL database username */
define( 'DB_USER', 'XXX' );
/** MySQL database password */
define( 'DB_PASSWORD', 'XXX' );
/** MySQL hostname */
define( 'DB_HOST', '127.0.0.1:XXX' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', 'utf8mb4_0900_ai_ci' );
define( 'AUTH_KEY', 'XXX' );
define( 'SECURE_AUTH_KEY', 'XXX' );
define( 'LOGGED_IN_KEY', 'XXX' );
define( 'NONCE_KEY', 'XXX' );
define( 'AUTH_SALT', 'XXX' );
define( 'SECURE_AUTH_SALT', 'XXX' );
define( 'LOGGED_IN_SALT', 'XXX' );
define( 'NONCE_SALT', 'XXX' );
/**#@-*/
/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'XXX';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/support/article/debugging-in-wordpress/
*/
define( 'WP_DEBUG', false );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
Dies ist meine php.ini ohne Kommentare:
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
open_basedir = "/var/www/"
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,show_source,highlight_file,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
disable_classes =
zend.enable_gc = On
zend.exception_ignore_args = On
expose_php = Off
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 256M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_tmp_dir = "/tmp"
upload_max_filesize = 250M
max_file_uploads = 20
allow_url_fopen = Off
allow_url_include = Off
default_socket_timeout = 60
cli_server.color = On
pdo_mysql.default_socket=
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
bcmath.scale = 0
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
zend.assertions = -1
tidy.clean_output = Off
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
ldap.max_links = -1
Ich habe PHP wie folgt installiert:
sudo apt install php libapache2-mod-php php-mysql
Hilft das, @GeraldSchneider?
Antwort1
Hinzufügen
define('FS_METHOD','direct');
zu Ihrer wp-config.php
Datei.