I have an FTP wrapper for a GUI app run by a PHP script (too lazy to write a real FTP client with sockets). Because it’s just a wrapper all the variables are passed to the script as command line arguments. I noticed that ftp_chmod was failing and tried to simply give it the correct permission in the script (0755 say for example) and it worked. I conclude that the value from $env was a string and thus confused the function. I then attempted to type cast the variable $env[‘permissions’] to an integer but that also failed.
Basically the only way I could make the function work was by giving it the argument from inside the script: ftp_chmod($connection, 0755, $file) but the identical code ftp_chmod($connection, intval($env[‘permissions’]), $file) failed ?.
any ideas? I’m totally confused and find a work around. thanks in advance I appreciate your time.