I need to know what may be causing the issue (wysiwyg
is not under storage root path) of not being able to upload image. Any idea would help a lot.
Here is a screenshot of the error message with red highlight
I need to know what may be causing the issue (wysiwyg
is not under storage root path) of not being able to upload image. Any idea would help a lot.
Here is a screenshot of the error message with red highlight
As of 2.2.3, it's not possible to upload images via the WYSIWYG if the media directory is a symlink. This is due to this new file. UPDATE: This issue has been fixed in Magento 2.2.5 and 2.3.0. See this Github issue and the fix.
We've temporarily fixed this by changing this line from this:
$realPath = realpath($path);
$root = $this->directoryList->getPath($directoryConfig);
to this (note the addition of the realpath
function call):
$realPath = realpath($path);
// BEGIN EDIT
/**
* Since media directory is a symlink, need to run both paths through realpath in order for the comparison to
* work.
* The proper fix for this should involve a STORE > Configuration setting where an admin can choose whether to
* allow symlinked directories.
*/
$root = realpath($this->directoryList->getPath($directoryConfig));
// END EDIT
All information taken from this ticket as pointiA mentioned.
Run the below command and check it:
php bin/magento config:set system/security/max_session_size_admin 0
php bin/magento c:f
If your folder is not showing then create the below code.
For security purposes, Magento provides Media Gallery access to contents in specific folders. The configuration path system/media_storage_configuration/media_storage/allowed_resource/media_gallery_image_folders
in config.xml
is used to define “Media Gallery Allowed” folders
By default, Magento allows Media Gallery access to the following two directories under /pub/media:
catalog/category
wysiwyg
app/code/VendoreName/ModuleName/etc/config.xml
:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<system>
<media_storage_configuration>
<allowed_resources>
<catalog_images_folder>catalog</catalog_images_folder> <!-- Show Catalog Folder -->
<media_gallery_image_folders>
<category_image_folder>catalog/category</category_image_folder> <!-- Show Sub Catalog Folder -->
<my_image_folder>custom_folder_name</my_image_folder>
<my_catalog_image_folder>catalog/custom_folder_name</my_catalog_image_folder>
</media_gallery_image_folders>
</allowed_resources>
</media_storage_configuration>
</system>
</default>
</config>
looks like you are using the latest Magento 2.2.3. They did some security improvements that prevent using symlinks and so.
Maybe this issue will help you: https://github.com/magento/magento2/issues/13929
You have a problem with permissions.
For Linux - You must run this commands:
find ./pub/media -type d -exec chmod 777 {};
For Window - You must create a folder wysiwyg
in this path C:/xamp/htdocs/rohivic/pub/media/
and you click right on project folder to Properties and you must be unchecked the Read Only.
wysiwyg
Daniel First, you can open a terminal then you can go in your Magento files then you can give permission Pub folder.
chmod -R 777 pub/
if can't working this commnad you can try to sudo chmod -R 777 pub/