Server configuration error. Correct path for Bedrock
-
Hi I have problem with set right path for Bedrock boilerplate.
Uploads have path web/app/uploads.
How can I set right path by webpc_uploads_path filter ?
-
This topic was modified 6 years ago by
kris1110.
-
This topic was modified 6 years ago by
-
Hi @kris1110,
Thank you for your message.
Recently, someone else contacted me about this. In this thread: https://wordpress.org/support/topic/files-created-in-uploads-folder/
Could you answer that thread? This one will be closed.
I tested your 1.1.3 beta version plugin but I got these errors:
The path for uploads files does not exist. Please use the webpc_uploads_path filter to set the correct path. The default path is: C:\xampp\htdocs\projects\project\web\wp/wp-content/uploads/.
Unable to create or edit .htaccess file. Please change directory permissions. The default path of file is: C:\xampp\htdocs\projects\project\web\wp/wp-content/uploads/.htaccess.
-
This reply was modified 6 years ago by
kris1110.
What filters did you use? Give me the exact code you added.
What do you get when you call the following code?
<?php echo '<pre>'; echo '1. ' . apply_filters('webpc_uploads_path', '', true); echo PHP_EOL; echo '2. ' . apply_filters('webpc_uploads_webp', '', true); echo PHP_EOL; echo '3. ' . apply_filters('webpc_uploads_path', '', false); echo PHP_EOL; echo '4. ' . apply_filters('webpc_uploads_webp', '', false); echo '</pre>'; exit;1. wp-content/uploads
2. wp-content/uploads-webpc
3. C:\xampp\htdocs\projects\project\web\wp//wp-content/uploads
4. C:\xampp\htdocs\projects\project\web\wp//wp-content/uploads-webpcDo these catalogs from points 3 and 4 exist with you? Do you have write access there?
No they don’t exist, my uploads catalog there is in C:\xampp\htdocs\projects\project\web\app\uploads
In that case, how did you change the path using the
webpc_uploads_rootfilter?Example:
add_filter('webpc_uploads_root', function($root) { return ABSPATH; });Instead of
ABSPATH, please give your path.add_filter(‘webpc_uploads_root’, function($root)
{
$path = ‘C:\xampp\htdocs\projects\project\web\app\uploads’;
return $path;
});If I give my path manually, did makes the same errors like above.
What do you get when you call the following code now?
<?php echo '<pre>'; echo '1. ' . apply_filters('webpc_uploads_path', '', true); echo PHP_EOL; echo '2. ' . apply_filters('webpc_uploads_webp', '', true); echo PHP_EOL; echo '3. ' . apply_filters('webpc_uploads_path', '', false); echo PHP_EOL; echo '4. ' . apply_filters('webpc_uploads_webp', '', false); echo '</pre>'; exit;Still the same
1. wp-content/uploads
2. wp-content/uploads-webpc
3. C:\xampp\htdocs\projects\project\web\wp//wp-content/uploads
4. C:\xampp\htdocs\projects\project\web\wp//wp-content/uploads-webpc@kris1110, please download the plugin code from my site again. The link is the same. I corrected one thing there that should help.
In addition, please use the following filters:
This filter only indicates your main WordPress installation directory (not the
uploadsdirectory):add_filter('webpc_uploads_root', function($path) { return 'C:/xampp/htdocs/projects/project/web/'; });Here you specify the path to the
uploadsdirectory relative to the root directory:add_filter('webpc_uploads_path', function($path) { return 'app/uploads; });Here you specify the path to the
uploads-webpcdirectory relative to the root directory:add_filter('webpc_uploads_webp', function($path) { return 'app/uploads-webpc'; });After setting the filters, turn the plugin off and on.
Hi
I added :add_filter('webpc_uploads_root', function($path) { return 'C:/xampp/htdocs/projects/project/web/'; }); add_filter('webpc_uploads_path', function($path) { return 'app/uploads'; }); add_filter('webpc_uploads_webp', function($path) { return 'app/uploads-webpc'; });The error has disappeared, but htaccess have incorrectly url:
it should be web/app not web/wp/app# BEGIN WebP Converter # ! --- DO NOT EDIT PREVIOUS LINE --- ! <IfModule mod_mime.c> AddType image/webp .webp </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{DOCUMENT_ROOT}/projects/project/web/wp/app/uploads-webpc/$1.jpg.webp -f RewriteRule (.+)\.jpg$ /projects/project/web/wp/app/uploads-webpc/$1.jpg.webp [T=image/webp] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{DOCUMENT_ROOT}/projects/project/web/wp/app/uploads-webpc/$1.jpeg.webp -f RewriteRule (.+)\.jpeg$ /projects/project/web/wp/app/uploads-webpc/$1.jpeg.webp [T=image/webp] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{DOCUMENT_ROOT}/projects/project/web/wp/app/uploads-webpc/$1.png.webp -f RewriteRule (.+)\.png$ /projects/project/web/wp/app/uploads-webpc/$1.png.webp [T=image/webp] </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/webp "access plus 1 year" </IfModule> # ! --- DO NOT EDIT NEXT LINE --- ! # END WebP Converter -
This reply was modified 6 years ago by
The topic ‘Server configuration error. Correct path for Bedrock’ is closed to new replies.