Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-30T17:40:24-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16498 2011-12-30T17:40:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59273#p59273 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
Yes, I have wp-content outside of the WP installation root.

I've implemented your suggested code to disable s2member-o.php and my registration form has style again and I can undo my patch.

Thanks again.

Statistics: Posted by leeomara — December 30th, 2011, 5:40 pm


]]>
2011-12-30T16:30:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59261#p59261 <![CDATA[Re: s2Member unable to locate WordPress directory]]> Thanks for the heads up on this thread.
leeomara wrote:
Raam Dev wrote:I setup WP in it's own directory per these instructions:
http://codex.wordpress.org/Giving_WordP ... _Directory
I setup WP-content per these instructions:
http://codex.wordpress.org/Editing_wp-c ... wp-content

For the time being, I've (reluctantly) hacked the plugin to update utils-s20.inc.php's wp_dir method setting $starting_dir with the path to WP. This works as a temporary solution, but it's less than ideal.
The s2member-o.php file is designed to load only the s2Member plugin in a few special situations, in order to conserve system resources. This further optimizes s2Member's delivery of dynamic CSS/JS files to a browser.

The s2member-o.php file will look for your root WordPress directory, starting from your s2Member installation directory, and/or from $_SERVER["SCRIPT_FILENAME"], which is sometimes different.

This error that you received, would indicate to me that s2Member is running from a location that is not within your root WordPress directory? Thus, s2Member is unable to move back up your directory tree and find the /wp-settings.php file. If this problem continues, please post a set of directory paths so I can see where your WordPress installation is at, relative to your s2Member plugin directory.

Note, it is fine to do what is described here:
http://codex.wordpress.org/Giving_WordP ... _Directory

It it also fine to move your /wp-content/ directory, but not outside of the WordPress installation root:
http://codex.wordpress.org/Editing_wp-c ... wp-content
( s2Member needs to be somewhere inside your WordPress root directory )

I'll see what we can do to make this possible in a future release. s2Member can be located anywhere, as long as it's somewhere under the root directory of your WordPress installation itself. Placing your /wp-content/ directory completely outside of the WordPress installation root is not something the /s2member-o.php file is capable of handling.

The /s2member-o.php file is the only aspect of s2Member with this limitation. If you'd like to avoid this issue all together, you can tell s2Member NOT to use it all. If you'd like to go that route, you can create this directory and file:

/wp-content/mu-plugins/s2-hacks.php
Code:
<?php
add_action
("ws_plugin__s2member_after_loaded", "s2_hacks"); function s2_hacks()
    {
        $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"] = site_url("/");
    }
?>

Statistics: Posted by Jason Caldwell — December 30th, 2011, 4:30 pm


]]>
2011-12-29T15:22:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59126#p59126 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
I also tried the Twenty Ten and Twenty Eleven themes (both 1.3), with the same results.

Statistics: Posted by leeomara — December 29th, 2011, 3:22 pm


]]>
2011-12-29T14:39:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59117#p59117 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
I'm going to ask another support rep if he has any ideas what might be causing this. In the meantime, could you please try disabling all your plugins (except s2Member) and see if that fixes the problem?

Statistics: Posted by Raam Dev — December 29th, 2011, 2:39 pm


]]>
2011-12-29T12:00:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59109#p59109 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
Local development: Apache 2.2.21 and PHP 5.3.8 via mod_php

Staging: Apache 2.2.3 and PHP 5.3.5 via FastCGI

Statistics: Posted by leeomara — December 29th, 2011, 12:00 pm


]]>
2011-12-29T10:59:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59099#p59099 <![CDATA[Re: s2Member unable to locate WordPress directory]]> Thank you for the update.

Could you take a look at this thread and see if mod_security might be causing this issue? http://www.primothemes.com/forums/viewt ... 36&t=14787

Also, could you tell me what web server (and version) you're using, along with your version of PHP?

Statistics: Posted by Raam Dev — December 29th, 2011, 10:59 am


]]>
2011-12-28T12:51:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=59015#p59015 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
Raam Dev wrote:
Could you check the documentation under WP Admin -> s2Member -> General Options -> Localhost? Have you followed the notes there?


I've set define("LOCALHOST", true); in wp-config.php, but I'm still getting "ERROR: s2Member® unable to locate WordPress® directory." instead of CSS from s2member-o.php.

Some further information:

I setup WP in it's own directory per these instructions:
http://codex.wordpress.org/Giving_WordP ... _Directory
I setup WP-content per these instructions:
http://codex.wordpress.org/Editing_wp-c ... wp-content

For the time being, I've (reluctantly) hacked the plugin to update utils-s20.inc.php's wp_dir method setting $starting_dir with the path to WP. This works as a temporary solution, but it's less than ideal.

Thanks for your help with this issue.

Statistics: Posted by leeomara — December 28th, 2011, 12:51 pm


]]>
2011-12-23T23:50:03-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=58691#p58691 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
Could you check the documentation under WP Admin -> s2Member -> General Options -> Localhost? Have you followed the notes there?

Statistics: Posted by Raam Dev — December 23rd, 2011, 11:50 pm


]]>
2011-12-23T14:36:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=58650#p58650 <![CDATA[Re: s2Member unable to locate WordPress directory]]>
I don't know of any issues related to using s2Member with that type of setup, but I'm going to inquire with our lead developer just to be sure.

Statistics: Posted by Raam Dev — December 23rd, 2011, 2:36 pm


]]>
2011-12-22T18:51:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16498&p=58574#p58574 <![CDATA[s2Member unable to locate WordPress directory]]>
Requests like
http://localhost/wp-content/plugins/s2m ... mber_css=1

Produce this error message: "ERROR: s2Member® unable to locate WordPress® directory." instead of returning CSS.

Particulars of this installation:

- WP is in a subdirectory (httpdocs/core)
- WP_CONTENT_DIR points to a directory beside "core" (httpdocs/wp-content)
- The site is running v111220 + s2Member Pro v111220

It seems that the wp_dir method in utils-s2o.inc.php is not able to find my WP install.

Is this a known issue? What can I do to help s2member find my WP install?

Statistics: Posted by leeomara — December 22nd, 2011, 6:51 pm


]]>