Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

regars,


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_pass 127.0.0.1:9090;
    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: 65.94.70.3, 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: 65.94.70.3, server: alex, request: "GET /favicon.ico HTTP/1.1", host: "alex.site.com"

share|improve this question

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
add comment

2 Answers

The log entry makes it pretty obvious.

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

Try providing a filename that exists.

share|improve this answer
    
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
add comment

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

short_open_tag=On

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

Edit

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.

share|improve this answer
    
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
add comment

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