Sublime Forum

Sublime SFTP won't "upload on save" php files

#1

Hi,

I am using Sublime Text 2 with Sublime SFTP and have searched around for an answer but can’t find anything.

When I’m saving a html, css, js - file, the file gets uploaded to remote server with no problems, but this does not work with my php files?? Right clicking and upload file works fine.

I’m new to Sublime Text, and I’m sure that there is something I’ve done to cause this, because it was working earlier.

Some help would be very much appreciated! :smile:

0 Likes

#2

Okay,

I know this is from 2013 but I ran in to this problem today and found a solution for it, so I wanted to post it here.
I couldnt figure it out until I read this from the settings tab in the SFTP page:

upload_on_save
If files should be automatically uploaded when saved. Files that match the ignore_regex pattern are not automatically uploaded.

And my problem was in my ignore_regex I had one that over-rode my automatic upload. Like leftyhio, I could manually click and upload but saving and uploading wasn’t working.

Here is my ignore_regexes array:
“ignore_regexes”: [
“\.sublime-(project|workspace)”, “sftp-config(-alt\d?)?\.json”,
“sftp-settings\.json”, “/venv/”, “\.svn/”, “\.hg/”, “\.git/”,
“\.bzr”, “_darcs”, “CVS”, “\.DS_Store”, “Thumbs\.db”, “desktop\.ini”,

        "\\.mp4","\\.jpg","\\.zip","\\.m4v","/vendor/","\\.txt","\\.log","\\.gif","\\.sql",
        "\\.dat","\\.png","/lib/","\\.psd","\\.pdf","\\.mp3","\\.JPG","\\.svg","/jen/","\\.png","\\.mov","\\.MP3",
        "\\.bash_logout","\\.ftpquota","\\.contactmail","\\.gitconfig","\\.mysql_history","\\.bash_profile","\\.bashrc",
        "\\.lastlogin","\\.zshrc","\\error_log","\\.viminfo","\\.bash_history","\\access_log","/.contactemail",
        "\\.cache","\\.srt",
        "/backups/","/cache/","/.config/","/.cpanel/","/.cphorde/","/.forever/","/.htpasswds","/.local","/.node-gyp","/.npm",
        "/.pki/","/.trash/","/etc/","/logs/","/mail/","/node_modules/","/perl5/","/public_ftp/","/tmp/","\\.node_repl_history",
        "/composer","/inc/","/wp-admin/","/wp-content/","/.well-known/","/wp-includes/","/countries/","/teaching-pool/","/www/"
    ],

And actually it was the “/www/” that was causing it fail. In my route of my server I have a symbolic link called www to public_html, I am not sure why it is there but that was stopping my from automatically uploading anything to public_html.

So check your ignore_regexes array one by one if you have to, and see if that is causing the problem.

Hope that helps someone.

0 Likes