Basic downloads will not work

Hi all,

I can not for the life of me get the basic downloads to work. The plugin works for everything else but downloads either produce 404 errors or they come back with an invalid key if I use that option. I have tried this on two servers and both end in the same results.

I have tried php, shortcodes, setting up a brand new server and installing s2member only (no theme either) and they all end with the exact issue. No option for the protected downloads.

I followed Jason’s advice on installing easyPHP and now I have no php options as it broke something. When I reinstalled it I get a line 82 error so I am not sure where to go.

I can lock down posts, I make it so users that have a ccap or member level can access content in articles but when it comes to downloading it has never once worked. I have read that I am not the only one that has had this issue and most users just ignore that function if the have problems. I need this option, I could careless about the posts options.

I am on Hostgator Business Cloud so if this works for anyone else can anyone tell me if it does work on Hostgator because I am about to just hire a company to build us a non Wordpress site.

I am pulling my hair out on this so any advice would be very helpful,
Ross Waters

Here is another step I have done to make sure it is not something stupid. I have removed IPs and Host names in this list but everything checks out fine.

Server Scan By: s2Member

No issues. Your server configuration looks great!

Pass[PASS] Apache Version
You are currently running Apache 2.2.31 (which is fine). Minimum required version is: 2.1.

Pass[PASS] PHP Version
You are currently running PHP 5.6.24 (which is fine). Minimum required version is: 5.2.

Pass[PASS] WordPress Version
You are currently running WordPress 4.6 (which is fine). Minimum required version is: 3.3

Pass[PASS] Multibyte String Extension
The mbstring extension is installed. Your server supports UTF-8 character conversion.

Pass[PASS] ZLib Extension (GZIP)
The zlib extension is installed. Your server supports GZIP compression.

Pass[PASS] Default Hash Extension
The Hash extension is installed. Comes with every installation of PHP. Your server supports message digests.

Pass[PASS] Default XML Parser Extension
The XML Parser extension is installed. Comes with every installation of PHP. Your server supports XML parsing.

Pass[PASS] Default libXML Extension
The libXML extension is installed. Comes with every installation of PHP. Your server supports this important
dependency.
Pass[PASS] Default Simple XML Extension

The Simple XML extension is installed. Comes with every installation of PHP. Your server can convert XML into PHP objects.

Pass[PASS] Default XML Reader Extension
The XML Reader extension is installed. Comes with every installation of PHP. Your server has the ability to read XML
documents.

Pass[PASS] Default XML Writer Extension
The XML Writer extension is installed. Comes with every installation of PHP. Your server has the ability to write XML documents.

Pass[PASS] Default DOM Extension
The DOM extension is installed. Comes with every installation of PHP. Your server supports XML document traversal.

Pass[PASS] Default Sessions Extension
The Sessions extension is installed. Comes with every installation of PHP. Your server allows read/write access to session data.

Pass[PASS] MySQL Database Extension
The MySQL extension is installed. Your server supports MySQL database communication.

Pass[PASS] Mcrypt/Encryption Extension
The Mcrypt extension is installed. Your server supports advanced data encryption.

Pass[PASS] Default JSON Extension
The JSON extension is installed. Comes with every installation of PHP. Your server supports JavaScript object notation.

Pass[PASS] GD Image Extension (JPEG/PNG/FreeType)
The GD Image extension is installed. Your server supports dynamic image creation.

Pass[PASS] Default Fileinfo Extension
The Fileinfo extension is installed. Comes with every installation of PHP 5.3+. Your server supports MIME type detection.

Pass[PASS] Default Ctype Extension
The Ctype extension is installed. Comes with every installation of PHP. Your server supports character class detection.

Pass[PASS] PHP eval() Function
The eval() function is available.

Pass[PASS] PHP ini_get() Function
The ini_get() function is available.

Pass[PASS] cURL Extension w/ SSL Support
The cURL extension for remote communication via PHP is available (and the OpenSSL extension for PHP is enabled).

Pass[PASS] cURL Extension w/ SSL Support (connection test)
The cURL extension for remote communication via PHP is available (and the OpenSSL extension for PHP is enabled). Test HTTPS connection to: https://www.websharks-inc.com/robots.txt succeeded.

Pass[PASS] cURL Extension (localhost connection test)
The cURL extension for remote communication via PHP is available (and the OpenSSL extension for PHP is enabled). Test HTTP connection to localhost: succeeded.

Pass[PASS] INI fopen() URL w/ SSL Support
The setting allow_url_fopen is on in your php.ini file (and the OpenSSL extension for PHP is enabled).

Pass[PASS] INI fopen() URL w/ SSL Support (connection test)
The setting allow_url_fopen is on in your php.ini file (and the OpenSSL extension for PHP is enabled). Test HTTPS connection to: https://www.websharks-inc.com/robots.txt succeeded.

Pass[PASS] INI fopen() URL (localhost connection test)
The setting allow_url_fopen is on in your php.ini file (and the OpenSSL extension for PHP is enabled). Test HTTP connection to localhost: succeeded.

Pass[PASS] OpenSSL Extension With openssl_sign()
The OpenSSL extension is installed, and PHP function openssl_sign() is available.

Pass[PASS] Temporary Files Directory
A readable/writable temporary files directory was found here: /tmp

Pass[PASS] $_SERVER[‘DOCUMENT_ROOT’]
Your server reports this value: ///*

Pass[PASS] $_SERVER[‘HTTP_HOST’]
Your server reports this value: domain

Pass[PASS] $_SERVER[‘REQUEST_URI’]
Your server reports this value: /mr/s2-server-scanner.php

Pass[PASS] $_SERVER[‘REMOTE_ADDR’]
Your server reports this value: XXX.XXX.XXX.XXX

Pass[PASS] $_SERVER[‘HTTP_USER_AGENT’]
Your server reports this value: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Pass[PASS] $_SERVER[‘SERVER_ADDR’]
Your server reports this value: XXX.XXX.XXX.XXX

Pass[PASS] Plugin Directory Checksum (s2member)
Scanned all directories and files in the following plugin directory: //*/mr/wp-content/plugins/s2member. The checksum for this plugin directory (f14096d918671dbdf81642b92d9982b4), matches up with the official release of this plugin (f14096d918671dbdf81642b92d9982b4).

Pass[PASS] Plugin Directory Checksum (s2member-pro)
Scanned all directories and files in the following plugin directory: //*mr/wp-content/plugins/s2member-pro. The checksum for this plugin directory (3337dccc50d51884828075fa4393b8fc), matches up with the official release of this plugin (3337dccc50d51884828075fa4393b8fc).

Pass[PASS] WordPress Memory Limit
Your WordPress memory limit (WP_MEMORY_LIMIT in /wp-config.php, or by default), is set to: 256M

Pass[PASS] WordPress MAX Memory Limit
Your WordPress MAX memory limit (WP_MAX_MEMORY_LIMIT in /wp-config.php, or by default), is set to: 256M

Pass[PASS] WordPress External HTTP Requests
Your WordPress External HTTP Requests (WP_HTTP_BLOCK_EXTERNAL in /wp-config.php, or by default), is set to: FALSE

Pass[PASS] WordPress DB Charset
Your WordPress database charset (DB_CHARSET in /wp-config.php, or by default), is set to: utf8

Pass[PASS] WordPress DB Collation
Your WordPress database collation (DB_COLLATE in /wp-config.php, or by default), is set to: an empty string

Pass[PASS] WordPress Character Encoding
Your WordPress installation is operating with UTF-8 encoding, under: WordPress -› Settings -› Reading -› Encoding.

Pass[PASS] WordPress Home URL
Your WordPress home URL is configured to run on: , and that matches the current host name:

Pass[PASS] WordPress Site URL
Your WordPress site URL is configured to run on: , and that matches the current host name:

Pass[PASS] WordPress Debugging Mode
Your WordPress installation is NOT running in debugging mode (WP_DEBUG in /wp-config.php, or by default), is NOT set to TRUE.

@rosswaters

At the risk of offending you, are you absolutely sure you don’t have an error in your file path. That is, after all, the most common cause of 404 errors: the computer is looking for a file that isn’t there. Check carefully for spaces and underbars in your file names.

@JediShark is right about the most common reason for this type of problem. The second most likely cause is your host. I’m afraid HostGator these days is one of the worst for WP.

I even get this when I used his example-file.zip. I know about path and spacing.

Before with ccaps and php I could get keys to generate but when the file went to download it would take me to the signup page. I also would sometimes get a 503 error.

I can’t even get this to work, there is a pdf called file.pdf in the root of the folder
/wp-content/plugins/s2member-files/file.pdf
Using this <a href="[s2File download=“file.pdf” inline=“true” /]">View PDF</a results in a 404 error.

I can link to outside WordPress just fine but those are open to the public and I need file protection.

We had our site moved to a cloud server 2 weeks ago. I don’t know what program or host could be to blame but even when I went to install a new WordPress under a sub domain I had to manually install s2member because it would inform me that there was no plugin in the installer of s2member.

Hi Tim, I am afraid that it is my host. Who does everyone recommend?

We had everything working on a regular server from them but they said that we were using too much CPU and told us we needed to move to the Cloud Service. We paid for the new service and had them move our site and left the other server up while we figure things out.

Currently we have some angry customers and my attitude on the whole thing is awful. Makes me want to abandon WordPress all together.

Ross

Please ensure that 1) you set the right path AND 2) you have the file you try to download on that path.

I didn’t think this forum used shortcodes.

s2File download=“file.pdf” inline=“true” View PDF

You will need to fill in the href with brakets in your head cause it won’t spit the text out.

They are there.

You know when I click the shortcode (s2File download=“file.pdf” inline=“true” View PDF) my address bar shows this as a result [s2File%20download=.

it ends with the =

My guess is that my host may be the issue.
I used this and the example-file.zip and I get the %20 between the s2File and download. Is that correct?

FTP usage with the url of /wp-content/plugins/s2member-files/file.pdf downloads the file from my admin account. So this proves that it is in place and works.

I did have 0464 on the securities. I changed it to 755 but no luck.

OK how you set the link on the page? If shortcode is seen in the address bar, this may means it is not executed (s2M is not replaced it with the need security URL).

I use to use php exclusively and I have yet to get that going again since easyPHP was installed.

Can you give me steps on making it work. I do everything in NotePad ++ then move it into the text editor on WordPress.

Is this method not accepted?

Yes, that’s correct. %20 is URL code for a space. But the bracket [ should not show up in the URL. The whole shortcode should be rendered as a proper URL in the address bar.

I sympathize with your views of WordPress. While I love many things I can do with it, I hate the fact that there are so many charlatans making money and offering advice about it. But that’s true of other walks of life too, so the trick (as always) is to identify whom and what you can trust.

Which brings me to the question of a good host. I use LightningBase, and I recommend them unequivocally. They are outstanding. Do a Google search for them, and I doubt you’ll find any contrary opinions. LittleBizzy also looks very good, and they offer Comet Cache (by the s2Member developers) on all their sites, so I doubt you’d have any problems running s2Member there either.

No way, it depends of your settings of the page…

In PHP environment you can run a shortcode with this function:
do_shortcode(’[your shortcode here]’);
This returns the result of shortcode as string. To put on page use “echo”. Hope that helps.

Thanks Tim,

I will look into them. I do pay for WP Rocket and love it so I will look at LightningBase.

With that I get a Parse error. /wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(91) : eval()'d code on line 5

I am 90% sure Hostgator destroyed my site when they moved it. Every time I install a plugin something new pops up, I remove it and it leaves the basic functions non working.

I will pay for yet another hosting service and have the programmers remake everything. I can’t deal with no PHP, it is just a waste to even think I can salvage this when so many issues arise from a plugin being installed or removed.

Thanks,
Ross

“Parse error” means that PHP runs well, but you may have syntax error in shortcode. I think you are one step before to get it to run. Just read manuals and think.

Just an update and a user question. We decided to move to bluehost, I would have moved to LightningBase but we move terabytes of data each month and their system is a bit out of our budget at the moment. Later I may migrate to them but for the moment we need 100GBs minimum storage and un-metered bandwidth.

After unzipping and installing the WordpPess system and setting up the database for it to use we are happy. We recreated all our pages and copied the php back to the way it was and now our site is 10 times faster and we haven’t even installed our paid for caching software.

We decided, just having our team recreate everything would be better, we also fixed a few things in the process like moving images outside of WP to further hide that we are on such a platform. All php and downloads work as expected and at this point I am just thinking that the migration from the first move destroyed some basic function on the system.

I do have one question that I hope someone can answer. I tried to move all our customers in S2Member and it said it would not because our customers were not in the WordPress database. What data fields do I need to move that pertain to our customers in WordPress and is there a program plug-in that would work for this. I can do it myself if I know what fields I need to move. A plugin would be sweet but we are willing to do it our self.

Thanks for all your help,

Ross

Glad you’ve got it working, Ross! There are several good WP plugins for moving sites but, since you are just talking about the database, WP Migrate DB (https://wordpress.org/plugins/wp-migrate-db/) is probably the most suitable for your purpose.

Thanks Tim,

This looks like a great plugin, and I will user it in the future for sure.

It won’t work for the moment cause it looks like that WP Migrate DB pushes all Data Fields and I need %USERDATABASE% and what ever other fields that pertain to users and only users.

I am not 100 percent familiar on how and where all the user info is set up in WordPress. I tired a test dev site and moving just %USERDATABASE% caused that site to not allow any log-in option. I know I didn’t grab everything due to this and the test server didn’t have a email account attached to it so I could not recover the loss. I am planning the same attempt on the live server cause that one has an email account attached to it so if it fails I can at least request a password change.

I am also afraid moving all fields will just end up in what was broken to be rewritten to the new site. The only thing that is the same in this new site is page structure, other than that it is a 100% new system with anything that could be moved out of the WP-Content to be removed. The last thing we want is our site to be hacked after we make all these changes so we are removing anything that could say WP out in the root directory.

We can do this because we have set up WP in a sub folder and then we will just move the index.php to the root and make any needed changes from there to direct the site. This also make it so we do not have to depend on photo uploads to be performed by WordPress its self. We will use FTP, then link them to the gallery with absolute paths.

For the s2member team, do I need to copy the encryption key over to the new system if I perform an import of s2members users? If not will setting up a new encryption key work, that part of the info is a bit fuzzy to me.

Thanks for any help on this part,
Ross