localhost (with symlink) / apache / wp-cli install refers to wrong folder!
-
Hi, this problem is killing me!
I have setup Fedora 25 and Apache, MariaDB and PHP. It took 3 days, but all the settings now seem good.
I can use wp-cli to install and configure WP with 0 install errors shown on the command line, all databases created, and it all seems good BUT…
I have a folder with all my sites in /home/david/sites and I have made a simlink to it sudo ln -s /home/david/sites /var/www/html. This is where I create a directory and install WP with wpcli.
I have mod-rewrite setup in the apache preferences AND wp-cli, and here is my wp info to confirm:
PHP binary: /usr/bin/php
PHP version: 7.0.18
php.ini used: /etc/php.ini
WP-CLI root dir: phar://wp-cli.phar
WP-CLI packages dir:
WP-CLI global config: /home/david/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 1.1.0(I can use the duplicator plugin to clone a previously saved site into a folder in my sites directory and it works 100% including the permalinks.)
When I create a WP site inside sites/example I visit http://localhost/sites/example/ and there it is BUT all the references inside the site have a 404 and refer to the wrong directory (for example):
http://localhost/example/wp-content/themes/twentyseventeen/style.css?ver=4.7.5
The part of the directory ‘sites’ has vanished! I just can’t work out what is going on, it’s driving me crazy! In case anyone else is having problems to get this far, here’s what I needed to do… there was no decent guide anywhere:
MANY THANKS TO THE GENIUS TO HELP ME!
install
——-
sudo dnf -y install php php-mysqlnd php-opcache (for drupal) sendmail (for wp-cli) (maybe php-mcrypt) mariadb-server phpmyadminstart the services (lamp-start.sh)
——————sudo systemctl start httpd.service
sudo systemctl start mariadb.servicesetup security
————–
sudo mysql_secure_installationchange phpmy admin setting to allow logging into (root or whatever) with no password
————————————————————————————
sudo gedit /etc/phpMyAdmin/config.inc.php$cfg[‘Servers’][$i][‘AllowNoPassword’] = TRUE;
change some apache settings
—————————sudo gedit /etc/httpd/conf/httpd.conf
1. change ‘User david’ (from apache)
allow mod-write
—————2. # AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride AllMake symbolic link from apache server default directory to your sites directory
——————————————————————————-sudo ln -s /home/david/sites /var/www/html
Tell SELinux that these files/directories are allowed to be modified by Apache
——————————————————————————chcon -R unconfined_u:object_r:httpd_sys_rw_content_t:s0 /home/david/sites
The topic ‘localhost (with symlink) / apache / wp-cli install refers to wrong folder!’ is closed to new replies.