Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-16 20:56:01

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Getting file uploads to work on Scotch Box (Vagrant) [SOLVED]

Dear Textpattern aficionados,

I started using Vagrant a while back for development, and I’ve found Scotch Box to be a reliable LAMP stack that requires almost no configuration—like it says in the tin, it “just works”.

Except for one thing: I can’t get file uploads to work in Textpattern.

My Diagnostics and Files panels both report that my “File directory path is not writable” (Temp directory isn’t writable either). But there is no problem on the Images panel, and I confirmed image uploads work perfectly, despite having identical permissions.

This problem is solved!

By writing about it, I accidentally surfaced the root of the problem. Here’s the solution, just in case you run into the same problem. Or, more likely, in case it happens to me again and I can’t remember how I fixed it before.

In the Advanced preferences panel, I noticed that my image directory (the one that works for uploads) had a relative path: simply images. But the files and temp directories (the ones that Textpattern was complaining about) had absolute paths, like so: /Users/john/Sites/example.com/public/files.

Trouble is, Textpattern was running on the Vagrant’s virtual mirror of my files, not on my file system. The correct path to my site’s document root was: /var/www/public, putting the files directory at /var/www/public/files and the temp directory at /var/www/public/textpattern/tmp. Fixing those settings under Advanced preferences solved the problem: Textpattern recognized the directories as writable!

I still had a problem of files failing to upload, but I fixed that by editing the Scotch Box php.ini file using the vagrant shell and restarting the server. post_max_size and upload_max_filesize were the settings I had to change for that. Thank you, Textpattern’s native help system!

Offline

Board footer

Powered by FluxBB