I just transfered a website to a new server; here is my sites conf (vhost) in nginx and the last 2 entries from error.log .

The images are not displaying when the index.php loads.


server {

    listen   80; ## listen for ipv4
    listen   [::]:80 default ipv6only=on; ## listen for ipv6

    server_name  maissane;

    access_log  /var/log/nginx/localhost.access.log;

    root   /var/www/alex.site.com;
    location / {
            index  index.html index.htm;

    location ~ \.php$ {
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;


____________log errors:

2013/03/02 16:01:51 [error] 16637#0: *35 open() "/var/www/alex.site.com/images/right_<" failed (2: No such file or directory), client:, server: alex, request: "GET /images/right_%3C?=%20$theme;%20?%3E.jpg HTTP/1.1", host: "alex.site.com", referrer: "http://alex.site.com/index.php?p=bio"

2013/03/02 16:01:51 [error] 16637#0: *35 open() "/var/www/alex.site.com/favicon.ico" failed (2: No such file or directory), client:, server: alex, request: "GET /favicon.ico HTTP/1.1", host: "alex.site.com"

closed as not a real question by Michael Hampton, mdpc, Khaled, growse, MadHatter Mar 4 '13 at 10:32

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I get lots of errors in error.log: – Rich Mar 2 '13 at 12:08

The log entry makes it pretty obvious.

You don't actually have a file /images/right<?= $theme; =?>.jpg.

Try providing a filename that exists.

  • There's a substitution that works on my other server. right_'ThemeName'.jpg Why wouldn't it substitute anymore properly? – Rich Mar 2 '13 at 12:16
  • Who knows? Your question doesn't even address that issue. Perhaps you should look into it? – Michael Hampton Mar 2 '13 at 12:17

As it seems the issue is in PHP config rather than nginx. Check your php.ini config for short_open_tag directive - it should be On, like


or change the code to /images/right_<?php echo $theme; ?>.jpg.


As people point out, the usage of php short tags is not recommended for various reasons, one of which you are now experiencing(new server doesn't support them by default). See this SO thread for more info..
Thus the solution for you is to find all relevant occurences of <? and <?= and to replace them by <?php and <?php echo respectively.

  • Please don't use short open tags. – Michael Hampton Mar 2 '13 at 12:38
  • @MichaelHampton you are right, i just explain the issue to OP.. – Shimon Rachlenko Mar 2 '13 at 12:39
  • I changed it to short_open_tag=On although the default value I believe is "On"... – Rich Mar 2 '13 at 12:48
  • 2
    @Rich short open tags have defaulted OFF for many years. Their use is not recommended. – Michael Hampton Mar 2 '13 at 12:50
  • Thank you; my bad. Not recommended because of conflicts with xml. Much appreciated! – Rich Mar 2 '13 at 13:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.