Restoring the edited file from git fixes the error.
Solution: Your problably being hosed by the 'EnableSendfile' directive.
Disable it by adding "EnableSendfile Off" to your apache config file.
Sendfile allows apache to send data from a file without doing a seperate read and send operation. It however doesn't work well with NFS shares.
While I'm not sure how the shared folder in vagrant works, it appears to be impacted by this setting. Here are the apache 2.2 docs for this module.
Thanks to the folks of the virtualbox forums for discussing this issue and possible solutions and preventing me from wasting another day on this issue.
Setting up an FTPS server securly is a big pain. If your environment is behind a NAT, sometimes the server doesn't even know what its public address is, which makes enabling PASV mode fun!
I'm trying to connect to a server setup like this and when I enable PASV mode, it responds with an unroutable internal address.
FileZilla works around this issue by ignoring the address and using the servers inital address instead and everything works as expected.
PHP's FTP library does not. It happily accepts the unroutable address and ultimately fails to connect moments later.
This guy knows what I'm talking about and actually patched php to fix this bug.
If you have a moment, please vote this bug up so it makes it into php's next offical release.
It was reported in 2011 in version 5.3 and is still unassigned.
While looking for something to help php connect to a sftp server I stumbled across libphpsec which is a fantastic library that has no dependencies and works in all versions of php. The documentation takes a "cookbook" approch which works really well for me.
The real genius to this library is it makes no assumptions about your environment.
If a suitable native function doesn't exist, there is a pure php one to pick up the slack.
The following are implemented in pure php:
Symmetric key encryption
I'm amazed that someone loved this problem enough to do this much work on it and thankful he chose to open-source it.
Terrafrost, if your ever able to make it to the Austin PHP Beverage Subgroup; (4th Wednesday) the drinks are on me guy.
Zend framework recently moved to git and I'm starting to integrate it into our release scripts.
The previous command used svn export and the tag for the release I wanted.
It took a little while to figure out how to do this with git:
git clone --depth 1 --branch release-1.12.3 https://github.com/zendframework/zf1.git /where/do/you/want/it/zf1/1.12.3/
rm -f -r /var/www/vhosts/ZendFramework/1.12.3/.git
A few differences from svn:
git has the complete revision history in every checkout. By adding the –depth 1, we're only getting the history relevant to our selected 'branch' and greatly speeding up the checkout of this giant project.
git doesn't do tags like svn/cvs. A tag isn't a branch, its a human friendly name for a revision hash. The command is –branch but it doesn't have to be a branch. It can also be a tag or commit hash. You'll get a warning about head being disconnected, its not relevant in my case because I'm not making change to or managing this folder with .git after I get it checked out.
git doesn't have an 'export' method because it doesn't need it. All the git revisions are in the .git folder in the root of the project instead of spread all over kingdom come like svn and cvs. Just delete the .git folder and now the project is no longer under git revision control.
This helped a lot and has other possible solutions.
If you need great server monitoring, use copper egg. It inexpensive, easy to install and very very good.
If you happen to use PHP with Linux, a lot of usesful information can be extracted from the /proc filesystem. Enough to provide basic monitoring. The attached script dumps and processes the output from proc every minute as json.
Make sure to protect the directory you're outputing this into to.
Download livestats.php code