Jump to:

4873 Posts in 7242 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Nginx and tiny_mce_gzip.php issues!

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 615 Views
  • mrsteveheyes
    Avatar
    Community Member
    15 Posts

    Nginx and tiny_mce_gzip.php issues! Link to this post

    Hi there,

    I am having real problems with Silverstripe, NGINX and tiny_mce_gzip.php. I have Silverstripe cms and framework "3.0.*@stable" installed. I am running PHP-FPM (PHP 5.3.10-1ubuntu3.6) and NGINX (v1.1.19) on Ubuntu 12.04.2 LTS. I have successfully installed the CMS etc fine and can access the front end and the back end.

    However, when I log into the backend admin section, and click on a page to edit, the tiny_mce_gzip.php doesn't load.

    This means that none of the Javascript will work on the page edit page, thus I can't change any template, add content etc.

    My nginx conf file is:

    server {
    server_name datalink.dev static.datalink.dev www.datalink.dev;
    access_log /var/log/nginx/datalink_dev_access.log;
    error_log /var/log/nginx/datalink_dev_error.log debug;
    root /srv/nginx/datalink/dev/public/;

    include /etc/nginx/nocrawl.conf;

    include /etc/nginx/common.conf;

    location / {
    try_files $uri @silverstripe;
    #if_modified_since off;
    }

    location ~ ^/framework/.*(rpc|tiny_mce_gzip)\.php$ {
    include /etc/nginx/fastcgi_params;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    }

    location @silverstripe {
    include /etc/nginx/fastcgi_params;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    fastcgi_param SCRIPT_FILENAME $document_root/framework/main.php;
    fastcgi_param SCRIPT_NAME /framework/main.php;
    fastcgi_param QUERY_STRING url=$uri&$args;

    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    }

    location ~ /\.ht {
    deny all;
    }

    location ~ ^/silverstripe-cache {
    deny all;
    }

    location ^~ /assets/ {
    try_files $uri $uri/ =404;
    # access_log off;
    # log_not_found off;
    # expires 7d;
    #add_header Pragma public;
    # add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    location ~ \.ymal {
    deny all;
    }

    location ~ ^/(cms|framework|mysite)/.*\.(php|php[345]|phtml|inc)$ {
    deny all;
    }

    location ~ ^/(cms|framework)/silverstripe_version$ {
    deny all;
    }

    location ~ ^/framework/.*(main|static-main|rpc|tiny_mce_gzip)\.php$ {
    allow all;
    }
    }

    Has anyone encountered this problem before? Does anyone know how to stop it? Can anyone see what I have done wrong!?!

    Really appreciate it because I have spent hours trying to figure it out and I am just stumped!

  • Bam
    Avatar
    Community Member
    16 Posts

    Re: Nginx and tiny_mce_gzip.php issues! Link to this post

    Hi Steve

    I have the same problem. Did you ever have any luck?

    Cheers
    Sam

  • Bam
    Avatar
    Community Member
    16 Posts

    Re: Nginx and tiny_mce_gzip.php issues! Link to this post

    Got it sorted now. No amount of restarting nginx was fixing it. Rebooted server and now it works. Very strange! If you are still having troubles I can post my configs.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Nginx and tiny_mce_gzip.php issues! Link to this post

    I initially had problems with tiny_mce_gzip.php, but it was caused by the PHP configuration not setup correctly. normal php extensions wouldn't be served at all (404s), but SilverStripe requests were fine... turns out my location ~ \.php$ directive was broken.

    I've written a blog post about setting it up nginx with PHP-FPM. Fedora/RHEL Linux specific, but the same sort of thing can be applied to other flavours of Linux. In this case I split up the php and silverstripe into separate configs and applied it per-virtualhost, might be a bit tidier especially for environments with multiple sites.

    Sean

    615 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.