Closed mkraha closed 6 years ago
Probably need to start by looking at the error output. Depending on your server's PHP config, it might be in the body of the response, or it might be in your Apache/Nginx logs.
At first glance, that code looks fine. Not that many moving parts here, which is nice. Maybe it can't find test.php
? I can't remember how it handles relative paths. That has tripped me up in other situations, so I'm kind of paranoid about it now. I generally use __DIR__
all the time to be safe:
$service->render(__DIR__.'/views/test.php');
I think some PHP configs also disable the <?=
syntax in favor of the more verbose <?php echo
. Not a fan personally, but people do it. If that's the case, you'd need to tweak your PHP config, or use the more verbose syntax.
Those are my 2 best guesses. The error output should make it clear if it's either of those things, or something entirely different I've failed to notice.
Thank you for the reply. I fixed that by updating .htaccess by following
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I receive only 500 internel error on doing echo of $this->pageTitle.
index.php
test.php
<?= $this->pageTitle; ?>