Zend Framework - app doesn't work - Error

I have an old Zend Framework 1 app that runs on my current Debian system so far.Now I wanted to set up this app also on my NixOS system, of course with the same packages of Apache/2.4.48, PHP version 7.3.29 and PostgreSQL 11. Unfortunately I get the following error message on the NixOS:

**Fatal error** : Uncaught Zend_View_Exception: script '/.phtml' not found in path
(/application/modules/default/views/scripts/) in /library/Zend/View/Abstract.php:987 Stack trace: #0
/library/Zend/View/Abstract.php(883): Zend_View_Abstract->_script('/.phtml')
#1/Zend/Controller/Action/Helper/ViewRenderer.php(910): Zend_View_Abstract->render('/.phtml') #2
/library/Zend/Controller/Action/Helper/ViewRenderer.php(931):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('/.phtml', NULL) #3
/library/Zend/Controller/Action/Helper/ViewRenderer.php(970):
Zend_Controller_Action_Helper_ViewRenderer->render() #4 /ehochdrei-skillware/libr in
**/library/Zend/Controller/Plugin/Broker.php** on line **335**

I’m pretty sure this is related to the .htaccess. In the .htaccess my app says the following:


order deny,allow
allow from all
#require valid-user


SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

In my configuration.nix I made the following settings for the vhost:

  services.httpd.virtualHosts."testware.de" = {
    serverAliases = ["testware.de"];
    documentRoot = "/home/bavramor/data/Webdesign/Webseiten/testware/public";
    extraConfig = 
    ''
      #SetEnv APPLICATION_ENV development

      #RewriteEngine On
      #RewriteCond %{REQUEST_FILENAME} -s [OR]
      #RewriteCond %{REQUEST_FILENAME} -l [OR]
      #RewriteCond %{REQUEST_FILENAME} -d
      #RewriteRule ^.*$ - [NC,L]
      #RewriteRule ^.*$ index.php [NC,L]

      <Directory "/home/bavramor/data/Webdesign/Webseiten/testware/public">
        DirectoryIndex index.php index.htm index.html
        Allow from All 
        Options FollowSymLinks
        Order allow,deny
        AllowOverride All
      </Directory>
    ''; 
  };

As you can see, I have also tried to enter the settings directly into the vhost, but that didn’t help either. The rewrite engine is running, but somehow it doesn’t seem to do the rewrites correctly. In the /var/log I can’t find any error message that might help me. So as mentioned before, the app is running on my Debian system. Would appreciate any help or ideas.

Thanks and greetings

Bavra.

Hi Brava,

I’m not convinced that the issue is your .htaccess file yet. From the error log you pasted the symptom appears to be that a script filename is missing, and only the extension is there (script '/.phtml' not found). Is there any additional context you can provide? Any additional error logs?

How similar is your debian environment? What version of php is it running?

Hi aanderse, so I have the information with htaccess directly from the developer itself. That he can not find the file /.phtml because the rewrite does not work properly. In fact, I just took the package now and threw on a Debian, there the app then actually runs so without problems.

The Debian has the following versions:

**PHP Version 7.4.22**
psql (PostgreSQL) 11.12 (Debian 11.12-0+deb10u1)
Server version: Apache/2.4.38 (Debian)

The corresponding vhost set up and everything was running:

<VirtualHost *:80>
        ServerName domain.intern.adelphi.de
        DocumentRoot /var/www/html/domain/public/
#        ServerPath /phabricator/
        RewriteEngine on
#        RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
#        RewriteRule ^/favicon.ico   -                       [L,QSA]
#        RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
 
   <IfModule mod_fcgid.c>
      SuexecUserGroup www-data www-data
        <FilesMatch "\.php$">
          SetHandler "proxy:unix:/var/run/php/php-fpm-www-data.sock|fcgi://localhost"
        </FilesMatch>
    </IfModule>

 
<Directory "/var/www/html/domain/public/">
         Options FollowSymLinks
        AllowOverride AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        require all granted
</Directory>
</VirtualHost>

In the log files apache/httpd and in the app own log files there are no entries!

Greetz und THx

I’m going to assume this code is private and I can’t get a copy to play around with and get working - if that is not the case ping me and I’ll be glad to try and get it working.

The AllowOverride All statement generally means .htaccess files will work… aside from that the only thing I can think of might be checking the value of security.limit_extensions (PHP: Configuration - Manual).