Page 1 of 1

Issues with Wordpress 3.7

PostPosted: October 26th, 2013, 8:56 am
by roly445
Hi all,

Has anyone successfully got Wordpress 3.7 work right on Phalanger. I get getting errors like this all the time.

Code: Select all
 fwrite(): Supplied resource is not a valid Stream resource

Re: Issues with Wordpress 3.7

PostPosted: October 26th, 2013, 9:09 am
by Jakub Misek
Hi,

This may be caused by a plugin.

To find out more, you can debug the application.

Please give me know if I can help you with it.

Thanks,

Re: Issues with Wordpress 3.7

PostPosted: October 26th, 2013, 12:40 pm
by roly445
All the errors resolve to the 'class-http.php' file. After take a bit of a look, it looks like its stuck in a loop on line 864. this happens on a fresh install of the latest Wordpress. It stops me from getting into the admin area at all.

Re: Issues with Wordpress 3.7

PostPosted: October 26th, 2013, 7:50 pm
by Dilbert
Hi,
I have the same issue here usinga fresh installation of wpdotnet and ugrading to Wordpress 3.7. Logging into the administration is not possible. Even opening the normal pages is not possible anymore.

I'm using a Windows Server 2008 R2 with .NET 4.0.

Unfortunatly I don't have a debugger on that system so I can't tell you more.

Dilbert

Re: Issues with Wordpress 3.7

PostPosted: October 30th, 2013, 5:13 pm
by dulfe
I think the problem is than WordPress 3.7 changed the way they connect to remote resources, now they use "stream_socket_client" as indicated in their source files. (class-http.php class "WP_HttpStreams")

Code: Select all
/**
 * HTTP request method uses PHP Streams to retrieve the url.
 *
 * @package WordPress
 * @subpackage HTTP
 *
 * @since 2.7.0
 * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
 */


Does Phalanger supports sockets?.

Thanks.

Re: Issues with Wordpress 3.7

PostPosted: October 30th, 2013, 6:06 pm
by Jakub Misek
streams are not. However I just updated to WP 3.7.1 under Phalanger, and it works for me (Win7/x64/IIS 7.5).

There might be certain features not working properly, anyway basically it seams to work fine.

Re: Issues with Wordpress 3.7

PostPosted: October 30th, 2013, 6:14 pm
by dulfe
It works... but now try to upgrade any plug ins using the dashboard... and it will fail.

This is what I did:

I created a new WordPress instance using wpdotnet, upgraded it to 3.7.1.... so far so good.... now try to update the plug ins and it never finishes.

I enabled debugging and I got this info:

Code: Select all
Notice: Undefined property: wpdb::$base_prefix in C:\inetpub\deleteme01\wp-includes\wp-db.php on line 566, column 3.

Notice: add_custom_background is deprecated since version 3.4! Use add_theme_support( 'custom-background', $args ) instead. in C:\inetpub\deleteme01\wp-includes\functions.php on line 2919, column 5.

Notice: add_custom_image_header is deprecated since version 3.4! Use add_theme_support( 'custom-header', $args ) instead. in C:\inetpub\deleteme01\wp-includes\functions.php on line 2919, column 5.

Notice: Use of undefined constant STREAM_CLIENT_CONNECT - assumed 'STREAM_CLIENT_CONNECT' in C:\inetpub\deleteme01\wp-includes\class-http.php on line 787, column 5.

Warning: stream_socket_client(): Error connecting 'tcp://api.wordpress.org:80': tcp://api.wordpress.org:80 in C:\inetpub\deleteme01\wp-includes\class-http.php on line 787, column 5.

Warning: stream_set_timeout(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 804, column 3.

Warning: fwrite(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 839, column 3.

Warning: feof(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 899, column 12.

Warning: fread(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 900, column 5.

Warning: feof(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 899, column 12.

Warning: fread(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 900, column 5.

Warning: feof(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 899, column 12.

Warning: fread(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 900, column 5.

Warning: feof(): Supplied resource is not a valid Stream resource in C:\inetpub\deleteme01\wp-includes\class-http.php on line 899, column 12.


And it never finishes and from now on you will not be able to get to the admin site.

Re: Issues with Wordpress 3.7

PostPosted: October 30th, 2013, 7:35 pm
by dulfe
More info...

I created an small sample that uses the same socket functions as wordpress and it did not work. (copied from PHP Docs)

Code: Select all
<?php
$fp = stream_socket_client("tcp://www.google.com:80", $errno, $errstr, 30, STREAM_CLIENT_CONNECT);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fwrite($fp, "GET / HTTP/1.0\r\nHost: www.google.com\r\nAccept: */*\r\n\r\n");
    while (!feof($fp)) {
        echo fgets($fp, 1024);
    }
    fclose($fp);
}
?>


The error:

Code: Select all
Notice: Use of undefined constant STREAM_CLIENT_CONNECT - assumed 'STREAM_CLIENT_CONNECT'.

Warning: Error connecting 'tcp://www.google.com:80': tcp://www.google.com:80.
No such host is known (11001)


The same program in regular PHP works fine.

Any ideas?

Thanks.

Re: Issues with Wordpress 3.7

PostPosted: November 1st, 2013, 1:04 pm
by dulfe
I found the problem (looking at the source code)... the function "SplitSocketAddressPort" does not support schemas, only the URL and PORT (in "Streams.Sockets.CLR.cs"), also, the function "Connect" has a TODO item that has not been implemented yet... the "Schema Extraction".... so it only accepts remote hosts without it.

It will connect to "www.google.com:80", but it will not to "tcp://www.google.com:80".

So... for all of use that need WordPress 3.7 working on Phalanger, manual changes have to be made to both functions and recompile the class library. (If you know any other way to make it work without changing the source code, please share!)

Hope it helps someone. :D