Grow your CSS skills. Land your dream job.

PHP in Dropbox Folder?

  • # February 10, 2013 at 3:42 pm

    I keep the files for the site I’m working on in a Dropbox folder so that I can work on them from wherever I am and always have up to date files.

    I’d like to use PHP for some SSI type things, but I can’t seem to render them in a browser from the Dropbox folder. Does that make sense? Is there a solution, using Dropbox or otherwise?

    # February 10, 2013 at 4:29 pm

    To serve php files, the webserver has to create the content. Dropbox does not allow this to happen. When you are seeing pages in Dropbox, the browser is rendering them. It is the same as having an .html file on your desktop that you open in Chrome or something.

    If you want to server php files, you need a webserver that has php installed.

    # February 10, 2013 at 4:54 pm

    May be a way of syncing from dropbox to a PHP server though.

    # February 10, 2013 at 5:11 pm

    Your question doesn’t give enough information to know how best to answer.

    It sounds like you don’t normally use PHP. Do you have some sort of server software installed on your machine? If so, can you confirm that PHP is installed and, if you are on apache, PHP files in your htdocs folder (or equivalent) work as normal.

    I apologise if the above questions sound obvious and/or patronising. I’m sure you understand the need for clarity, though.

    If the above answers are all positive, then you might want to look into symlinks. Are on windows or *nix?

    # February 10, 2013 at 8:46 pm

    You can install Dropbox on your server (VPS or with certain shared hosting providers). From there, you can place your site files in your desktop’s Dropbox and work on it there. Any changes you make it will automatically sync to your server. It’s also a great way for automatic backups.

    # February 11, 2013 at 8:42 pm

    I have Dropbox installed on my computer, and I use the files as any other that would be stored on my HD.

    PHP is installed on my Mac using Apache (I think) but that won’t work unless the files are in the htdocs folder, if I understand correctly.

    # February 11, 2013 at 8:54 pm

    @enjay Are you using Mamp?

    # February 12, 2013 at 3:09 am

    There are lots of solutions for your problem, but the one I would go for is using symlinks.

    Navigate in the terminal to your dropbox directory and type in the following:

    ln -s /path/to/htdocs/ ./htdocs

    Your dropbox folder should now have a folder in it called htdocs, which points to your apache’s htdocs folder. Just remember to replace /path/to/htdocs/ with the actual path.

    # February 15, 2013 at 9:49 am

    I have no clue if this is a good thing to do – however: I moved my whole dropbox folder to xampp/htdocs/Dropbox
    And it’s just fine – I can execute phpfiles wherever I wan’t in my project folders.
    So no problem.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".