No, as the owner of the directory is you but not apache (if it is apache web server), PHP has no right to chmod.
I have a question to you:
Were you successfully chmod the directory through ftp?
I am wonder if the (ftp) server can automatically chmod back after you break the ftp connection.
The most possible thing is that chmod is not permitted to execute by at least any ftp users.