1

I just downloaded one of my wordpress site from live, to setup locally. now when I go to the home page I see strange characters,

Warning: require_once(framework/framework.php): failed to open stream: No such file or directory in òœ/www/humar/wp-content/plugins/custom-coming-soon-page/index.php on line 20

Call Stack:
    0.0000     314816   1. {main}() /var/www/humar/wp-admin/index.php:0
    0.0002     324296   2. require_once('çßœ/www/humar/wp-admin/admin.php') /var/www/humar/wp-admin/index.php:10
    0.0003     324584   3. require_once('ƒ„œ/www/humar/wp-load.php') cØœÀçi:30
    0.0005     325156   4. require_once('W‡œ/www/humar/wp-config.php') :30
    0.0006     326684   5. require_once('œ/www/humar/wp-settings.php') W‡œ/www/humar/wp-config.php:90
    0.0304    2295464   6. include_once('òœ/www/humar/wp-content/plugins/custom-coming-soon-page/index.php') 
EÝ:190


Fatal error: require_once(): Failed opening required 'framework/framework.php' (include_path='.:/usr/share/php:/usr/share/pear:/usr/share/ZF/library:/usr/share/ZF/extras/library') in òœ/www/humar/wp-content/plugins/custom-coming-soon-page/index.php on line 20

Call Stack:
    0.0000     314816   1. {main}() /var/www/humar/wp-admin/index.php:0
    0.0002     324296   2. require_once('çßœ/www/humar/wp-admin/admin.php') /var/www/humar/wp-admin/index.php:10
    0.0003     324584   3. require_once('ƒ„œ/www/humar/wp-load.php') cØœÀçi:30
    0.0005     325156   4. require_once('W‡œ/www/humar/wp-config.php') :30
    0.0006     326684   5. require_once('œ/www/humar/wp-settings.php') W‡œ/www/humar/wp-config.php:90
    0.0304    2295464   6. include_once('òœ/www/humar/wp-content/plugins/custom-coming-soon-page/index.php') 
EÝ:190

var dump of my $_Server and $_ENV from local and server machine:
Server

array(26) {
  ["DOCUMENT_ROOT"]=>
  string(26) "/home/mysite1/public_html"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["HTTP_ACCEPT"]=>
  string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(13) "gzip, deflate"
  ["HTTP_ACCEPT_LANGUAGE"]=>
  string(14) "en-us,en;q=0.5"
  ["HTTP_CONNECTION"]=>
  string(10) "keep-alive"
  ["HTTP_COOKIE"]=>
  string(245) ""
  ["HTTP_HOST"]=>
  string(15) "mysite.com"
  ["HTTP_USER_AGENT"]=>
  string(74) "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0"
  ["PATH"]=>
  string(13) "/bin:/usr/bin"
  ["QUERY_STRING"]=>
  string(0) ""
  ["REDIRECT_STATUS"]=>
  string(3) "200"
  ["REMOTE_ADDR"]=>
  string(14) "120.211.169.138"
  ["REMOTE_PORT"]=>
  string(5) "43397"
  ["REQUEST_METHOD"]=>
  string(3) "GET"
  ["REQUEST_URI"]=>
  string(8) "/env.php"
  ["SCRIPT_FILENAME"]=>
  string(34) "/home/mysite1/public_html/env.php"
  ["SCRIPT_NAME"]=>
  string(8) "/env.php"
  ["SERVER_ADDR"]=>
  string(13) ""
  ["SERVER_ADMIN"]=>
  string(25) "webmaster@mysite.com"
  ["SERVER_NAME"]=>
  string(15) "mysite.com"
  ["SERVER_PORT"]=>
  string(2) "80"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["SERVER_SIGNATURE"]=>
  string(0) ""
  ["SERVER_SOFTWARE"]=>
  string(6) "Apache"
  ["UNIQUE_ID"]=>
  string(24) "T14tb63sWlIAADSScZQAAAAO"
}

$_SERVER

array(30) {
  ["DOCUMENT_ROOT"]=>
  string(26) "/home/mysite1/public_html"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["HTTP_ACCEPT"]=>
  string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(13) "gzip, deflate"
  ["HTTP_ACCEPT_LANGUAGE"]=>
  string(14) "en-us,en;q=0.5"
  ["HTTP_CONNECTION"]=>
  string(10) "keep-alive"
  ["HTTP_COOKIE"]=>
  string(245) ""
  ["HTTP_HOST"]=>
  string(15) "mysite.com"
  ["HTTP_USER_AGENT"]=>
  string(74) "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0"
  ["PATH"]=>
  string(13) "/bin:/usr/bin"
  ["QUERY_STRING"]=>
  string(0) ""
  ["REDIRECT_STATUS"]=>
  string(3) "200"
  ["REMOTE_ADDR"]=>
  string(14) "120.211.169.138"
  ["REMOTE_PORT"]=>
  string(5) "43397"
  ["REQUEST_METHOD"]=>
  string(3) "GET"
  ["REQUEST_URI"]=>
  string(8) "/env.php"
  ["SCRIPT_FILENAME"]=>
  string(34) "/home/mysite1/public_html/env.php"
  ["SCRIPT_NAME"]=>
  string(8) "/env.php"
  ["SERVER_ADDR"]=>
  string(13) ""
  ["SERVER_ADMIN"]=>
  string(25) "webmaster@mysite.com"
  ["SERVER_NAME"]=>
  string(15) "mysite.com"
  ["SERVER_PORT"]=>
  string(2) "80"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["SERVER_SIGNATURE"]=>
  string(0) ""
  ["SERVER_SOFTWARE"]=>
  string(6) "Apache"
  ["UNIQUE_ID"]=>
  string(24) "T14tb63sWlIAADSScZQAAAAO"
  ["PHP_SELF"]=>
  string(8) "/env.php"
  ["REQUEST_TIME"]=>
  int(1331572079)
  ["argv"]=>
  array(0) {
  }
  ["argc"]=>
  int(0)
}


Local

$_ENV

array(0) {
}

$_SERVER

array(26) {
  ["HTTP_HOST"]=>
  string(9) "localhost"
  ["HTTP_USER_AGENT"]=>
  string(74) "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0"
  ["HTTP_ACCEPT"]=>
  string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
  ["HTTP_ACCEPT_LANGUAGE"]=>
  string(14) "en-us,en;q=0.5"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(13) "gzip, deflate"
  ["HTTP_CONNECTION"]=>
  string(10) "keep-alive"
  ["HTTP_CACHE_CONTROL"]=>
  string(9) "max-age=0"
  ["PATH"]=>
  string(28) "/usr/local/bin:/usr/bin:/bin"
  ["SERVER_SIGNATURE"]=>
  string(70) "
Apache/2.2.14 (Ubuntu) Server at localhost Port 80

"
  ["SERVER_SOFTWARE"]=>
  string(22) "Apache/2.2.14 (Ubuntu)"
  ["SERVER_NAME"]=>
  string(9) "localhost"
  ["SERVER_ADDR"]=>
  string(9) "127.0.0.1"
  ["SERVER_PORT"]=>
  string(2) "80"
  ["REMOTE_ADDR"]=>
  string(9) "127.0.0.1"
  ["DOCUMENT_ROOT"]=>
  string(8) "/var/www"
  ["SERVER_ADMIN"]=>
  string(19) "webmaster@localhost"
  ["SCRIPT_FILENAME"]=>
  string(28) "/var/www/mysite/env.php"
  ["REMOTE_PORT"]=>
  string(5) "58712"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["REQUEST_METHOD"]=>
  string(3) "GET"
  ["QUERY_STRING"]=>
  string(0) ""
  ["REQUEST_URI"]=>
  string(16) "/mysite/env"
  ["SCRIPT_NAME"]=>
  string(20) "/mysite/env.php"
  ["PHP_SELF"]=>
  string(20) "/mysite/env.php"
  ["REQUEST_TIME"]=>
  int(1331572869)
}
Ravish
  • 2,383
  • 4
  • 37
  • 55

1 Answers1

2

Take a look at:

  • /var/www/humar/wp-admin/index.php
  • /var/www/humar/wp-admin/wp-config.php
  • /var/www/humar/wp-content/plugins/custom-coming-soon-page/index.php

to see if you find any of the unexpected characters there.

framework/framework.php isn't a file from Wordpress' standard distribution, so I assume it may have to do with the custom-coming-soon-page plugin you got there.

El Barto
  • 919
  • 1
  • 5
  • 18
  • yes, I've custom coming soon plugin. but, I do not see single quote (') as strange character. I find nothing suspicious there like my **.../coming--/index.php** `require_once("framework/framework.php"); require_once('framework/init.php');` there is nothing strange, + it is the same code working online – Ravish Mar 09 '12 at 23:40
  • first of all: does the file exist where the require_once is looking for? the path of the file which is failing to include is being printed correctly... there might be some strange behaviour on the representation of the error that is throwing you off... maybe encoding has nothing to do with the Fatal error here – El Barto Mar 09 '12 at 23:49
  • yes it does, I mean all the files are where they are required, but the strange char appended to the string is changing the actual path... – Ravish Mar 09 '12 at 23:55
  • I'd suggest then printing some system variables to see the differences in the environment between your local server and your live server. $_SERVER, $_ENV, etc. – El Barto Mar 10 '12 at 00:03
  • I've added my local and server. another difference on my local and server machine is, I've PHP Version 5.2.14 on server, but, PHP 5.3.2-1ubuntu4.9 on local machine. could it be a problem? – Ravish Mar 12 '12 at 17:21
  • I was looking at [this utf8 problem] (http://stackoverflow.com/questions/505562/detect-file-encoding-in-php), and I think it could be the same issue with me as well... can any one confirm ? and if so, how can I fix this problem ? – Ravish Mar 12 '12 at 17:25
  • 2
    That's an error with file reading, you're getting the error in PHP's error display. You could check the encoding of your PHP files to see if there's anything strange there. I see you're working on Linux, you can use the `file` command: `file -i your_file.php`. That will print something like this: `file.php: text/x-php; charset=us-ascii`. You can then use `iconv` to change files encoding. – El Barto Mar 12 '12 at 17:37
  • `file -i wp-settings.php wp-settings.php: text/x-php; charset=us-ascii` local encoding is us-ascii, could it be a problem ? should I convert files to utf-8 or something else ? – Ravish Mar 12 '12 at 17:51
  • I do not think encoding above is a problem, because, I just checked my other projects available locally, they too have same encoding, and they are working fine... – Ravish Mar 14 '12 at 17:27
  • I think there is some problem with the files I copy from other places to my disk, because, I just installed wordpress from the scratch, and it worked without any problem... I am not sure what problem I might be having with my local config or settings... any suggestion ??? – Ravish Mar 14 '12 at 17:45
  • The problem might be related to your customized plugin. What happens if you remove the files? (move them somewhere else) – El Barto Mar 15 '12 at 15:39
  • ok, I removed the custom plug in, (the coming soon plugin), and it all working fine... but, very strange, why is the plugin working online... – Ravish Mar 17 '12 at 13:02