Cannot creating folders with php

i used the manual from php.net but i cannot get it to work. Don't see what i am doing wrong. I get this error message when i try to do

Warning: ftp_mkdir(): Can't create directory: No such file or directory in /home/user/public_html/management/test.php on line 11
There was a problem while creating /home/user/public_html/images/screenshots/wiiu/alien_isolation/ 

below is the code i use...

        <?php

        $ftp_user_name = "user";
        $ftp_user_pass = "password";
        $ftp_server = "www.site.com";
        $gamename = "alien_isolation";
        $path = "/home/user/public_html/images/screenshots/wiiu/" . $gamename . "/";
        $conn_id = ftp_connect($ftp_server);
        $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

        if (ftp_mkdir($conn_id, $path)) {
         echo "successfully created $path\n";
        } else {
         echo "There was a problem while creating $path\n";
        } 

        ftp_close($conn_id); 

        ?>

edit: my php handler is set to DSO and now it works

Answers


Are you sure that the path

/home/user/public_html/images/screenshots/wiiu/

exists?


Set the php handler to DSO and it works


**Use this** 

<?php
        $ftp_user_name = "user";
        $ftp_user_pass = "password";
        $ftp_server = "www.site.com";
        $gamename = "alien_isolation";
        $path = "/home/user/public_html/images/screenshots/wiiu/";
        $conn_id = ftp_connect($ftp_server);
        $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
        @ftp_chdir($conn_id, $path);
        if (ftp_mkdir($conn_id, $gamename)) {
         echo "successfully created $path\n";
        } else {
         echo "There was a problem while creating $path\n";
        } 

        ftp_close($conn_id); 

        ?>

Need Your Help

HTTP GET from socket multiple events?

actionscript-3 http sockets air

How do you know if a socket server or web server is done transmitting a HTTP GET request when using ProgressEvent.SOCKET_DATA ?

How to check length only if not empty and if empty ignore

php if-statement comparison is-empty

I want to only check for length of this value if the variable is not empty and ignore checking length if the variable is empty. The following Always checks length and doesn't consider the first par...