This is strange, sometimes works, sometimes it doesnt.
I've put var_dumps of the link()'s arguments.
string(35) "/printbox/web/repo/docusearch/5.pdf"
string(82) "/printbox/web/repo/hardlink/Oleaginosa Moreno Hnos. S.A._20130715_000532989552.pdf"
__
A PHP Error was encountered
Severity: Warning
Message: link(): Operation not permitted
Filename: controllers/ct_form_procesar_escaneos.php
Line Number: 178
__
string(35) "/printbox/web/repo/docusearch/6.pdf"
string(77) "/printbox/web/repo/hardlink/MOLINOS RIO DE LA PLATA_20130715_000533396947.pdf" //THIS WORKED !!!
__ ABOVE WORKED (No error here and in fact hard link was created)
string(35) "/printbox/web/repo/docusearch/7.pdf"
string(77) "/printbox/web/repo/hardlink/RENOVA TIMBUES VICENTIN_20130715_000533520657.pdf"
__
A PHP Error was encountered
Severity: Warning
Message: link(): Operation not permitted
Filename: controllers/ct_form_procesar_escaneos.php
Line Number: 178
I really can't find any pattern.... and when I make a script to manually test one of the previous, also fails:
<?php
echo "Hi";
link( '/printbox/web/repo/docusearch/7.pdf', '/printbox/web/repo/hardlink/RENOVA TIMBUES VICENTIN_20130715_000533520657.pdf');
?>
Apache's log:
[Mon Jul 15 13:41:57 2013] [error] [client 192.168.100.204] PHP Warning: link(): Operation not permitted in /printbox/web/repo/a.php on line 3
Striping spaces for _ in the destination name didn't help.
Thanks!