Slim shows blank page

I am trying to follow this tutorial on my Windows 10 PC with WAMP. It basically shows how to get the example from the slim homepage working. When I go to “http://myslimsite/hello/David” or a similar URL, I get nothing, just a blank page. No errors are displayed. I don’t see anything in the PHP or apache error logs. I followed the video to a T, but it doesn’t work. I enabled virtual hosts by uncommenting “Include etc/extra/httpd-vhosts.conf” in httpd.conf, then setup the virtual host in httpd-vhosts.conf. Any help would be greatly appreciated.

what version of php?

My WAMP server has PHP 5.5.12 installed.

If you’re getting a blank page with no info in the logs, try putting this at the start of your index.php:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

For debugging purposes, this usually tells you what’s wrong.

2 Likes

I still got nothing even when I added those lines to the top of my index.php. So I decided to start again from the beginning and install Slim again. It works now. No idea what went wrong the first time, but I’m glad it’s working now.

Hi @sega_dude ,

Are you able to render an index.php ( with a minimal test) like given below, without slim or any other lib ? just to make sure virtual host is working fine. http://myslimsite/

<?php
// File Name : "index.php"
echo " Hello ... ";

Also please provide your php code. and .htaccess file contents. Its easy to look into code, than watching the whole video tutorial.

Thank you.

Everything is working now. I started from the beginning and reinstalled the Slim Framework. It works as expected now.

1 Like