Here's the configuration :

The directory :


is a shared directory (Linux) from a PC with an IP adress

My PC IP adress is

I mounted that shared dir with the command : mount -t cifs -o auto,username=myusername,password=mypass // /var/www/mount_ImpExp

If I try to manually launch a rsync with :

rsync -t /var/www/mount_ImpExp/ImpExp/compteur_assur /usr/bin/

This works :

ls -al /usr/bin/compteur_assur
-rwxr-xr-x 1 zobz zobz 2501 2009-06-09 15:44 /usr/bin/compteur_assur

Now I create a exec.php file in my website : the path is : /var/www/html/Internet/mywebsite

the source is :

echo date('d/m/Y H:i:s');
echo "<br />";
  system("rsync -t /var/www/mount_ImpExp/ImpExp/compteur_assur /usr/bin/"));

it doesn't work.

In the php.ini the "safemode" is "off". So I may be able to execute any shell command. If I try to modify the exec.php file and do a simple :

var_dump( system("ls -al ."));

It works. So the "system" call works.

Thus I tried to modify the options in the httpd.conf file :

    # Ajout Olivier Pons / 11 juin 2009
    <Directory "/var/www/mount_ImpExp/ImpExp">
        AddDefaultCharset UTF-8
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all

I then restarted the server and nothing works. What shall I do where should I look next ? I'm stuck...


Okay I found the problem : it a "permission problem" (or "rights problem" I don't know how to say it in English, sorry)

[Batman]:/var/www/html/Internet/mywebsite# chown apache:apache /var/www/mount_ImpExp/
chown: changing ownership of `/var/www/mount_ImpExp/': Permission denied
[Batman]:/var/www/html/Internet/mywebsite# chmod o+r /var/www/mount_ImpExp/
chmod: changing permissions of `/var/www/mount_ImpExp/': Permission denied

Looks like you are trying to change the permissions of files you don't own. You need to set yourself as the owner then chmod 750.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.