Page MenuHomePhabricator

MobileFrontend Installed & Only shows a Blank Page on Mobile Devices
Closed, DeclinedPublic

Description

Author: delucaw

Description:
Hey MobileFrontend,

I hate to submit this as a "Bug" because I am sure that the system probably works fine everywhere else, just not for me..

Here is the situation. I have an OLD mediaWiki Site that I have rebuilt and Upgraded. So now I have an Upgraded DB with a Fresh copy of the Latest Stable Release of MediaWiki.

I have installed the MediaWiki Extension: MobileFrontend per the instructions as I understood them. Thus, I downloaded the "Snapshot" for version 1.22, I made a "MobileFrontend" folder in the Extensions folder & copied the downloaded & unzipped files in, and I place the code below at the bottom of the Localsettings.php file:

require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";
$wgMFAutodetectMobileView = true;

I have added no addition configuration code. I am also under the assumption that this extension does not require any other extensions to operate.

Here are some PHP errors I found that are in possible relation to the issue at hand:
[PHP]
[16-Jan-2014 12:14:53 America/Denver] PHP Fatal error: Out of memory (allocated 5505024) (tried to allocate 262144 bytes) in /site/XXXXX.com/includes/AutoLoader.php on line 1191
[16-Jan-2014 12:11:41 America/Denver] PHP Fatal error: Call to undefined function mb_convert_encoding() in /site/XXXXX.com/includes/HtmlFormatter.php on line 66
[NGINX]
2014/01/16 17:05:47 [warn] 14031#0: *4305 a client request body is buffered to a temporary file /var/lib/nginx/tmp/client_body/0000000601, client: 69.198.41.161, server: XXXXXX.com, request: "POST /api.php HTTP/1.1", host: "betad.XXXXX.com", referrer: "http://betad.XXXXX.com/index.php?title=Category:Air_Canada&action=edit"

Here is the configuration info for my system:

  • MediaWiki 1.22 (Upgrade DB from 1.15)
  • PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
    • Memory Limit set to 512MB
    • Zend Engine v2.3.0
  • MySQL 5.1.69

Memcache is enabled with the following settings:

  • $wgMainCacheType = CACHE_MEMCACHED;
  • $wgParserCacheType = CACHE_MEMCACHED; # optional
  • $wgMessageCacheType = CACHE_MEMCACHED; # optional
  • $wgMemCachedServers = array( "misc-XXXXX.ajnafo.cfg.XXXX.cache.amazonaws.com:11211" );
  • $wgSessionsInMemcached = true;
  • $wgUseFileCache = false;

Installed Extensions Include:

  • MsUpload
  • googleAnalytics
  • MobileFrontend
  • WikiEditor
  • add-to-any-share-save
  • SpamBlacklist
  • AkismetKlik
  • Nuke

Nginx Settings:

http {

include       /etc/nginx/mime.types;
default_type  application/octet-stream;

server_names_hash_bucket_size 128;
client_max_body_size 16M;
server_tokens off;
client_body_buffer_size 1K;
client_header_buffer_size 1k;
large_client_header_buffers 2 1k;
index index.php index.shtml index.html index.htm default.html default.htm;

fastcgi_cache_path /site/_nginx_cache levels=1:2

keys_zone=XXX:32m
inactive=5m;

fastcgi_cache_key "$scheme$request_method$host$request_uri";

set_real_ip_from 10.0.0.0/8;
set_real_ip_from 10.XXX.70.XX;
real_ip_header X-Forwarded-For;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 'upstream_cache_status $upstream_cache_status'
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /site/logs/nginx.access.log  main;
    
    map $http_user_agent $ignore_ua {
	    default                 0;
	    "~Pingdom.*"            1;
	    "ELB-HealthChecker/1.0" 1;

}

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

gzip  on;

gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

server {

        listen       80;
        server_name  XXX.com XXX.com www.XXX.com beta.XXX.com betad.flyerguide.com stat.XXX.com;

        root   /site/XXX.com;

        access_log  /site/logs/access.XXX.log  main;
		error_log /site/logs/error.XXX.log  notice;

        # redirect server error pages to the static page /40x.html
        #
        error_page  404              /404.html;
        location = /40x.html {
            root   /usr/share/nginx/html;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
        
        location ^~ /(cache|includes|maintenance|languages|serialized|tests|images/deleted)/ {
                deny all;
        }
        
        location ^~ /(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
		internal;

}

        
        location @rewrite {
                rewrite ^/(.*)$ /index.php?title=$1&$args;
        }
        
        location / {
                try_files $uri $uri/ @rewrite;
        }
        
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                try_files $uri /index.php;
                access_log        off;
		log_not_found     off;
		expires           14d;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        }
        
        location = /_.gif {
                access_log        off;
		log_not_found     off;
		expires           14d;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
                empty_gif;
        }
        
        #location /dumps {
        #        root /var/www/mediawiki/local;
        #        autoindex on;
        #}

		location ~ \.php$ {
            fastcgi_pass  unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            #fastcgi_cache   XXX;
	    #fastcgi_cache_valid   200 302  30m;
	    #fastcgi_cache_valid   301      1d;
	    #fastcgi_cache_valid   any      15m;
	    #fastcgi_cache_min_uses  1;
	    #fastcgi_cache_use_stale error  timeout invalid_header http_500;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include /etc/nginx/fastcgi.conf;
        }

}


Version: unspecified
Severity: normal

Details

Reference
bz60170

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:02 AM
bzimport set Reference to bz60170.

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1634

Hi Bill, looking briefly over your situation, I see two problems based on the PHP errors:
[16-Jan-2014 12:14:53 America/Denver] PHP Fatal error: Out of memory (allocated

  1. (tried to allocate 262144 bytes) in

/site/XXXXX.com/includes/AutoLoader.php on line 1191

You will need to allocate more memory to PHP - 256KB is definitely not enough. I'm not sure what the right amount will be for your situation but you should play around with this configuration setting for PHP.

The other problem:
[16-Jan-2014 12:11:41 America/Denver] PHP Fatal error: Call to undefined
function mb_convert_encoding() in /site/XXXXX.com/includes/HtmlFormatter.php on
line 66

You must have PHP compiled without multibyte string support. If you can, you should either recompile PHP for multibyte string support or find a binary configured with it.

Hi Bill, can you check if this fixes your problem and if so/not let us know?
Thank you!

delucaw wrote:

My PHP Info page shows this for memory:
memory_limit 64M 64M
I have this directive in my php.ini:
memory_limit = 64M
And this Directive in my www.conf
php_admin_value[memory_limit] = 64M

And I do not have Multibye String enabled or installed that I could find. In order o test I ran this PHP:

<?php

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

mb_strlen("test");

?>

Which resulted with this error stating that there were no multi byte functions available:

Fatal error: Call to undefined function mb_strlen() in /site/flyerguide.com/testmb.php on line 6

delucaw wrote:

I also tried upping the limit to 512M but still not working :-\

bijusubhash wrote:

Hi,
for me also have the same issue.

You're lacking the mbstring PHP extension, which is required for MobileFrontend (and highly recommended for MediaWiki in general).

delucaw wrote:

Woot.. That worked!
I was confused when Arthur said:
"You must have PHP compiled without multibyte string support."

WONTFIX refers to "we are actively against fixing this" and FIXED refers to a code fix in MediaWiki. Both is not the case here. Hence setting WORKSFORME.