In Yii 1.1.project Images In Uploaded Are Not Shown On Remote Server

Hi all,

I uploaded my Yii 1.1.14 project on remote server and found that images in upload dir are not shown

Image in "images" directory like http://remote-server.com/tybapp/assets/mine/images/delete.png is shown ok Image in "uploads/" directory like http://remote-server.com/tybapp/uploads/cms_items/-cms_item-43/5cd790612da5.jpg are not shown and copied to browser it showes error

Unable to resolve the request "uploads/cms_items/-cms_item-43/44c9cc2b1edd.jpg".

Is it access error or what? On local server it worked ok. As for access I tried to set access 0755 to all dirs and files or 0755 to all dirs and 0644 to all files - with the same result.

Can it be that I have to edit my .htaccess for skipping images from yii pages routings ? If yes in which way ?

Thanks!

Assume your .htaccess in the applications webroot is similar to below.

The file “uploads/cms_items/-cms_item-43/44c9cc2b1edd.jpg” must exists, otherwise the Yii app will be initialized that looks for a module or controller ‘uploads’ and cannot resolve the request if no such controller/module exists.




RewriteEngine on


# Set RewriteBase if you app documentroot is an alias

# RewriteBase /tybapp 


# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d




# otherwise forward it to index.php

RewriteRule . index.php




Actually, that is how I try to do.

Please, open http://dev9.softreactor.com/tybapp/backend/cmsitem/edit?Cmsitem_page=1&cms_item_id=17 page

Below of RichText Editor there is list of images and delete.png image is shown but images of gallery are not shown.

Copying urls from source and putting into brwoser I see that gallary image

http://dev9.softreactor.com/tybapp/uploads/cms_items/-cms_item-17/9c06b6378082.jpg

calls error


"Internal Server Error"

Service image delete.png works ok :

http://dev9.softreactor.com/tybapp/assets/mine/images/delete.png

At bottom left there are 2 links to .htaccess files and phpinfo of server.

Seems, .htaccess is how you wrote.

File .htaccess was above tybapp/ directory and I moved it into tybapp/ directory and I changed it from


RewriteRule . tybapp/index.php

to


RewriteRule . index.php

So now I get error "Internal Server Error" and I can not understand why?

And when you set the rewriteBase in .htaccess?





RewriteBase /tybapp


...



Do you mean .htaccess :




RewriteEngine on


RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d




RewriteBase /tybapp




RewriteRule . index.php

?

Then Editors page http://dev9.softreactor.com/tybapp/backend/cmsitem/edit?Cmsitem_page=1&cms_item_id=17 again shows page without images

But Images link

http://dev9.softreactor.com/tybapp/uploads/cms_items/-cms_item-17/9c06b6378082.jpg

Shows


Internal Server Error


The server encountered an internal error or misconfiguration and was unable to complete your request.

In error_log file I found rows like:




[01-Jul-2014 23:37:46 America/Chicago] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/http.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/http.so: cannot open shared object file: No such file or directory in Unknown on line 0

Can it be reason of my problems ?

Of course this can be the reason.

You have to disable the no-debug-non-zts module in php.

I have no access to php.ini file of my server, can you give me a hint which command have I to enter in .htaccess

to get rid of this error?