Issues with Wordpress 3.7

Discussion about the open-source Phalanger [?] project.

Issues with Wordpress 3.7

Postby roly445 » October 26th, 2013, 8:56 am

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
roly445
 
Posts: 3
Joined: October 26th, 2013, 8:51 am

Re: Issues with Wordpress 3.7

Postby Jakub Misek » October 26th, 2013, 9:09 am

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,
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2062
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Issues with Wordpress 3.7

Postby roly445 » October 26th, 2013, 12:40 pm

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.
roly445
 
Posts: 3
Joined: October 26th, 2013, 8:51 am

Re: Issues with Wordpress 3.7

Postby Dilbert » October 26th, 2013, 7:50 pm

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
Dilbert
 
Posts: 1
Joined: October 26th, 2013, 7:46 pm

Re: Issues with Wordpress 3.7

Postby dulfe » October 30th, 2013, 5:13 pm

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.
dulfe
 
Posts: 9
Joined: July 2nd, 2013, 6:38 pm

Re: Issues with Wordpress 3.7

Postby Jakub Misek » October 30th, 2013, 6:06 pm

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.
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2062
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Issues with Wordpress 3.7

Postby dulfe » October 30th, 2013, 6:14 pm

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.
dulfe
 
Posts: 9
Joined: July 2nd, 2013, 6:38 pm

Re: Issues with Wordpress 3.7

Postby dulfe » October 30th, 2013, 7:35 pm

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.
dulfe
 
Posts: 9
Joined: July 2nd, 2013, 6:38 pm

Re: Issues with Wordpress 3.7

Postby dulfe » November 1st, 2013, 1:04 pm

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
dulfe
 
Posts: 9
Joined: July 2nd, 2013, 6:38 pm


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 1 guest

cron

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 1 guest
Phalanger