having trouble with deploying a nette app on a virtualhost
- savage
- Member | 2
hey guys.
I'm supposed to install a nette app on a web host. I've already set it up on my local test server and after some tweaking, it works as advertised. However, I'm having trouble deploying this on a web server (apache2 virtual host, php 5.2, mysql 5.0). I've copied the app, lib, etc. folders in the site root (/home/user) and the www in /home/user/www, which is the document root. I've 777'd the app/log, session and temp folders, WWW_DIR, APP_DIR and LIB_DIR all point to the right locations.
However, I can't get it to work. What's puzzling is that sometimes I get the first half of the homepage displayed (like once in 10 tries), the rest of the time I'm getting a mixture of 500 and 404's. This happens without me touching any of the files, just pressing ctrl-f5. the app/log files are empty and no errors are displayed in the browser.
The config files are all ok (database info, app and lib paths) and checker.php says everything is dandy. .htaccess is in place and tested ok. the only difference I see is my test server has php 5.3, but your minimum requirement says 5.2 will work, so I'm guessing this isn't an issue.
I've scouted the docs you have (well, the english ones) but had no luck with finding some sort of primer for setting things up. So, is there something I should play with on the web host?
EDIT: when the page gets displayed halfway trough, the error says “syntax error, unexpected T_FUNCTION” in File: /home/user/app/FrontModule/presenters/DefaultPresenter.php Line: 155.
Line 155: $form->onSubmit[] = function () use ($presenter, $form) {
this runs without a hitch on my test server.
Last edited by savage (2012-03-03 18:29)
- HosipLan
- Moderator | 4668
PHP 5.2 doesn't support closures. You can't develop application for newer version of language, use newer features and expect them to work on older version. The problem is in your application, not in Nette.
You have to either rewrite your app to be compatible with PHP 5.2, or upgrade hosting/PHP version on hosting.