简体   繁体   中英

Symlink in PHP not working

I am in a Linux environment. We have a CMS with 8 languages, and images are physical files in English: /store/products/image-car.png . We are trying to translate all these files with symlink, so we understand that we can save disk space and when the user links the navigator to /store/products/imagen-coche.png (spanish) it will show the file above.

symlink("/store/products/image-car.png" , "/store/products/imagen-coche.png");

But it is not working, it throws that it does not find the file. Must it be absolute path?

The best way to create symlinks is with absolute paths. However you can use relative path, but the symlink path should be relative to the original file. Also chech the webserver if symlinks are on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM