chmod(): Operation not permitted

If you get a warning like chmod(): Operation not permitted
You can use the ftp_site() function to send a CHMOD command through.

  1. $ftp_user_name = 'username';
  2. $ftp_user_pass = 'password';
  3. $ftp_server = 'ftp.server.com';
  4.  
  5. $connect = ftp_connect($ftp_server);
  6.  
  7. if (!ftp_login($connect, $ftp_user_name, $ftp_user_pass)) die("Couldn't connect");
  8.  
  9. @ftp_site($connect, 'CHMOD 0777 /public_html/folder_to_chmod/');
  10.  
  11. ... some process ... maybe upload ...
  12.  
  13. @ftp_site($connect, 'CHMOD 0755 /public_html/folder_to_chmod/');
  14. ftp_close($connect);

Remember this is just example, improve it yourself.
Hope this helps someone. You might need this solution if you are on a shared server.

By |2008-05-15T08:27:41+00:00May 8th, 2008|Coding, Tricky Tipsy| Comments

Comments

  1. ooo..bisa juga tho…

    gak pengen maen KotOR ta?

  2. JOKERz says:

    warior orochi lebih keren :)>-

  3. Aryo Sanjaya says:

    Pasti error deh joy, single quotenya [-(

    Please fix it ASAP

    :-\”

  4. JOKERz says:

    hehehehehe :d
    pantes warna na beda. Thanx ya