We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Volt works on Windows but not Ubuntu

Hi !

I'm a Phalcon newbie. I'm trying to change an simple application from Windows to Ubuntu. On Windows, it works fine. But when I put it on Ubuntu, it gives me a blank page without source or anything.

When I removed this line:

'compiledPath' => $config->application->cacheDir

In service.php file :

  $view->registerEngines(array(
    '.volt' => function ($view, $di) use ($config) {

        $volt = new VoltEngine($view, $di);

        $volt->setOptions(array(
            'compiledPath' => $config->application->cacheDir,
            'compiledSeparator' => '_'
        ));

        return $volt;
    }
));

It shows me the front page but another pages could not found. I tried to change Controller and View name in Case-sensitive as well but it doesn't work.

I spent a lot of hours finding the issue. Please, help me !

Thanks

Do you have write permissions to the Volt compiled path?

edited Feb '15

Hi @Michael !

I have changed all files of my application to write permission ( numberic values : 777 ) on FileZilla but it doesn't work.

Thanks for your help ! :)

Hi !

Did you check your server logs ? Maybe the answer is in it. If it's not, you may use Phalcon debug component:

https://docs.phalcon.io/fr/latest/reference/debug.html#debug-component

But i'm wondering did you clear the cache directory (on windows) and try to run the application ? Because if you don't compileAlways views you must have some result working but in fact it's not, it uses a old version which were working

edited Feb '15

Hi, @Brieuc !

How can I check my server logs. Is it error.log file? I looked at it but it's empty. Could you give me the link to learn server logs? I'm appriciate that. Thanks.

Here is what I tried. I downloaded the Invo example.It worked on Windows. I copied and pasted everything on Ubuntu server through FileZilla. I clean cache on my Browser and leave the cache directory empty. I set the cache directory to write permission ( numeric values: 777). It still doesn't work. :(

Hi

For the logs it depends of you're server. For me i do this to consult the 5 lasts entries:

sudo tail -5 /var/log/apache2/myWebsite-error_log

But in you're case you're just trying to use invo's code, so they won't be errors in the code. So i think you may check phalcon's installation on Ubuntu. For that it's pretty easy. You must make a phpinfo file:

<?php
echo phpinfo();
?>

Then you run that file in order to find a phalcon section. If you'll find it, your installation is fine, if not you may try to reinstall phalcon

Hope it will help you !

Phalcon installation is fine because when I deleted the line I mentioned above. the front page is showed up. I will find another way.

Thanks. :) I appreciate your helps, guys.



3.3k

Just try it with one volt tag - windows is not case-sensitive so things will work on windows but will stop on Ubuntu (linux). As a good dev practice, use Vagrant (https://vagrantup.com) so you won't get any surprises when you deploy

Thanks, @Chirs !

I will learn that.