gideongoldin / TurkGate

TurkGate: Grouping and Access Tools for External surveys (for use with Amazon Mechanical Turk)
http://gideongoldin.github.com/TurkGate
27 stars 5 forks source link

mcrypt dependency absence fails silently #84

Closed diogomarques closed 10 years ago

diogomarques commented 10 years ago

If the PHP5 mcrypt is not installed and enabled in the system, gateway.php fails silently. Meaning that everything looks okay in the HIT, the check ID works, but when workers accept the HIT, the link does not work.

The problem is in the calls to tempstorage.store() in gateway.php. The store function uses mcrypt, which is a module that does NOT come standard in all php5 installs.

Pissed of about 50 workers and lost half a day locating the issue.

Workaround for Ubuntu 14: sudo apt-get install php5-mcrypt add the following to php.ini: extension=mcrypt.so sudo service restart apache

Meanwhile, I suggest that you advise about this dependency in the README.

AdamDarlow commented 10 years ago

I'm sorry about the time this wasted for you. mcrypt appears to be the standard for PHP encryption/decryption and it is bundled in the Windows installation, so I mistakenly assumed it was bundled in all installations. The dependency is now listed in the README, and the next version will check during installation.

Were you able to successfully run a test from the admin page without mcrypt installed? It should have failed the same way it did for your workers. If it passed, I'll look into improving the test.

diogomarques commented 10 years ago

Yes, the test fails the same way it fails for workers. The problem is that it's not easy to see it failed, because you get a response. I suggest you improve the install script, so that it not only checks if a config file was created, but also that the dependency is met. Also output an error in the test.

AdamDarlow commented 10 years ago

TurkGate now checks for dependencies when installing.

We should also make it clearer when the test fails to redirect. If you don't know what test page to expect, it can be hard to tell something went wrong. I'll open a separate issue for that.