Archive for the ‘javascript’ tag
Large PHP scripts truncated on nginx
I spent a couple of hours yesterday trying to debug an issue that made me hit my head against the wall while it lasted.
I run multiple instances of WordPress, and with it, comes a nice little editor bundled called TinyMCE. But on my main WordPress installation (this very blog, dear reader, where you are reading this from), TinyMCE wouldn't come up, it wouldn't render properly on the browser, it didn't matter if it was my main browser, Chrome, or Firefox, Safari, cached, uncached, it was just broken. Since I hadn't have the time to go through this issue before, I was using a different editor installed as a plugin. LAME. And coward.
Anyway, I found out that one of the scripts wp-tinymce.php was being returned truncated. Because of that, Firebug would report that some TinyMCE bullshit wasn't defined (JavaScript, oh I'm not very fond of you). Oh, well. I tested calling that script under curl separately and in fact, it was only returning a fraction of the script, 44K out of the actual 200+K. I also found out that even though my nginx installation had gzip compression enabled and the PHP had zlib as well, the script wouldn't process the tinymce.js.gz but it was returning directly tinymce.js. It's alright, I just wanted it to work, no matter if it wouldn't go through gzip, that'd be a matter of some other day.
After a lot of googling I ended up reading this blog post (in Portuguese), suggesting to make sure the file permissions for both the client_body_temp and fastcgi_temp directories allowed the user running nginx (www-data in my case) to write in them. Apparently large scripts would start writing to disk on them temporarily while processing the shit. Of course, you wouldn't have this issue if you are running an nginx from your operating system package manager (like Debian's), but this might very well happen when you are running a custom nginx with separate modules and all sorts of crap on top of it:
chown www-data:www-data -R /usr/local/nginx/fastcgi_temp/; chmod -R 777 /usr/local/nginx/fastcgi_temp/; chown www-data:www-data -R /usr/local/nginx/client_body_temp/; chmod -R 777 /usr/local/nginx/client_body_temp/;
Obrigado, republicavirtual.com.br
Job offering
A friend of mine is asking me to publish his company's job offering to the wild. I've seen the offer, what they are doing and it's a very, very nice project/opportunity, I wouldn't announce it here on my blog if it wasn't something worthwhile:
Lytix is seeking an experienced software developer with proven ability
to produce, understand and critique code in C, Java and JavaScript;
Perl and LISP are a plus. He or she should have broad experience
working with heterogeneous environments and multiple platforms,
including BSD Unix/Linux, LAMP and other relevant F/OSS platforms.
Work will initially be project-based, but could evolve quickly into a
full-time position. The candidate will be based in Mexico City.
I'd also add: fluent English, both written and spoken is a must. If you are interested, please drop him a line, Diego Villarreal, and avoid putting me in between.



