PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

s2Member unable to locate WordPress directory

s2Member Plugin. A Membership plugin for WordPress®.

s2Member unable to locate WordPress directory

Postby leeomara » December 22nd, 2011, 6:51 pm

I'm getting some error-code 500 messages which are resulting in unstyled registration pages.

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?
User avatar
leeomara
Registered User
Registered User
 
Posts: 5
Joined: December 22, 2011

Re: s2Member unable to locate WordPress directory

Postby Raam Dev » December 23rd, 2011, 2:36 pm

Hi leeomara,

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.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: s2Member unable to locate WordPress directory

Postby Raam Dev » December 23rd, 2011, 11:50 pm

Hey leeomara,

Could you check the documentation under WP Admin -> s2Member -> General Options -> Localhost? Have you followed the notes there?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: s2Member unable to locate WordPress directory

Postby leeomara » December 28th, 2011, 12:51 pm

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.
User avatar
leeomara
Registered User
Registered User
 
Posts: 5
Joined: December 22, 2011

Re: s2Member unable to locate WordPress directory

Postby Raam Dev » December 29th, 2011, 10:59 am

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?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: s2Member unable to locate WordPress directory

Postby leeomara » December 29th, 2011, 12:00 pm

I can confirm that I do not have mod_security in place for my local development machine, nor for our staging server.

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
User avatar
leeomara
Registered User
Registered User
 
Posts: 5
Joined: December 22, 2011

Re: s2Member unable to locate WordPress directory

Postby Raam Dev » December 29th, 2011, 2:39 pm

Thank you for the additional info.

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?
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: s2Member unable to locate WordPress directory

Postby leeomara » December 29th, 2011, 3:22 pm

After disabling all plugins (except s2member), I still get "ERROR: s2Member® unable to locate WordPress® directory" instead of CSS for the request to /wp-content/plugins/s2member/s2member-o.php.

I also tried the Twenty Ten and Twenty Eleven themes (both 1.3), with the same results.
User avatar
leeomara
Registered User
Registered User
 
Posts: 5
Joined: December 22, 2011

Re: s2Member unable to locate WordPress directory

Postby Jason Caldwell » December 30th, 2011, 4:30 pm

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: Select all
<?php
add_action
("ws_plugin__s2member_after_loaded", "s2_hacks"); function s2_hacks()
    {
        $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"] = site_url("/");
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: s2Member unable to locate WordPress directory

Postby leeomara » December 30th, 2011, 5:40 pm

Thanks for the thorough response, background and interim workaround.

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.
User avatar
leeomara
Registered User
Registered User
 
Posts: 5
Joined: December 22, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

cron