Title: Error&#8211;Register.txt
Last modified: August 21, 2016

---

# Error–Register.txt

 *  [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-registertxt/)
 * Hi,
    Installed and activated but get error. there’s a missing file (register.
   txt) that is being called in several locations in galleryslider.php
 * May want to check your plugin and make sure all files exist.
 * Peter
 * [http://wordpress.org/plugins/gallery-slider/](http://wordpress.org/plugins/gallery-slider/)

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [tonioexp](https://wordpress.org/support/users/tonioexp/)
 * (@tonioexp)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543349)
 * Error Fixed, try to install again.=)
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543366)
 * Hi,
    Sorry but errors still exist.
 *     ```
       Warning: filesize(): stat failed for http://127.0.0.1/wordpress3.8/wp-content/plugins/gallery-slider/register.txt in C:\xampp\htdocs\wordpress3.8\wp-content\plugins\gallery-slider\galleryslider.php on line 35
   
       Warning: fread(): Length parameter must be greater than 0 in C:\xampp\htdocs\wordpress3.8\wp-content\plugins\gallery-slider\galleryslider.php on line 35
   
       Warning: fopen(C:/xampp/htdocs/wp-content/plugins/gallery-slider/register.txt): failed to open stream: No such file or directory in C:\xampp\htdocs\wordpress3.8\wp-content\plugins\gallery-slider\galleryslider.php on line 42
   
       Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress3.8\wp-content\plugins\gallery-slider\galleryslider.php on line 43
   
       Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress3.8\wp-content\plugins\gallery-slider\galleryslider.php on line 44
       ```
   
 * ??????
 * Peter
 *  [tonioexp](https://wordpress.org/support/users/tonioexp/)
 * (@tonioexp)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543446)
 * Can you please download the latest version of wordpress, thanks.
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543447)
 * Hi
    I have the latest version of wordpress installed (3.8.1) If you look to the
   right you will see that that is the version I stated when starting this. thanks
 *  [funckysoul](https://wordpress.org/support/users/funckysoul/)
 * (@funckysoul)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543512)
 * have the same problem. it works on local machine (MAMP) but doesn’t work on the
   server and pulling the same errors
 *  [lisabeewd](https://wordpress.org/support/users/lisabeewd/)
 * (@lisabeewd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543513)
 * [@tonioexp](https://wordpress.org/support/users/tonioexp/)
 * I installed your plugin on one of my client’s website and it runs perfectly with
   no errors. However, on another client’s website I run into the same errors described
   by Peter above.
 * The only difference between the two sites is that one is installed in the root
   directory and the other is installed in a subdirectory. In tracking the error
   I found your plugin is using $_SERVER[‘DOCUMENT_ROOT’] in your program gallery-
   slider.php when you are referring to the path for your register.txt file. The
   website I have installed in a subdirectory is the one showing the error because
   the subdirectory folder name is not in the document root.
 * You need to be referencing the WordPress function plugins_url() in order to get
   the path to the plugins folder. That would insure your plugin works for websites
   installed off the document root.
 * Lisa
 *  [lisabeewd](https://wordpress.org/support/users/lisabeewd/)
 * (@lisabeewd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543514)
 * [@tonioexp](https://wordpress.org/support/users/tonioexp/)
 * Scratch my reference to plugins_url(); … that function doesn’t get the server
   path but the url path. There should be a function that will get you the server
   path to the plugins folder, though.
 * Lisa
 *  [lisabeewd](https://wordpress.org/support/users/lisabeewd/)
 * (@lisabeewd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543515)
 * [@tonioexp](https://wordpress.org/support/users/tonioexp/)
 * Please forgive all my posts but I just found that
 * $pathtoplugin = plugin_dir_path(__FILE__ );
 * will give you the path to your plugin folder. I added it to the gallery-slider.
   php on my one installation that was getting the error and replaced the path references
   with the variable and the plugin runs without errors … so far. Yay!
 * Maybe you can go through your plugin and use the plugin_dir_path(__FILE__); code
   to get the server path to your plugin folder (it includes the trailing /) then
   those of us who have installed in subdirectories will be able to use your plugin!
   Which, by the way, works great!
 * Lisa
 *  [grantg182](https://wordpress.org/support/users/grantg182/)
 * (@grantg182)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543525)
 * Removed.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543526)
 * If you require assistance then, as per the [Forum Welcome](http://codex.wordpress.org/Forum_Welcome#Where_To_Post),
   please post your own topic.
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543527)
 * [@esmi](https://wordpress.org/support/users/esmi/) Theme Diva & Forum Moderator
 * What is your post supposed to mean? These posts and replies are all on topic.
   The plugin doesn’t work and throws errors. Don’t get why you’d say post your 
   own topic????
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543528)
 * **[@peter](https://wordpress.org/support/users/peter/)**: I agree that your posts
   and those of the plugin’s author are “on topic” but the 4 other people who decided
   to chime in with their issues need to post their own topics and stop hijacking
   yours.
 *  [lisabeewd](https://wordpress.org/support/users/lisabeewd/)
 * (@lisabeewd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543529)
 * [@esmi](https://wordpress.org/support/users/esmi/) … Wow … didn’t consider myself
   hijacking the post. Was only trying to help. Please feel free to remove all my
   posts to this topic. I was able to correct the error with the suggestions I made(
   which I thought were very relevant to [@peter](https://wordpress.org/support/users/peter/)’
   s post) but I guess you need to do it your way.
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543534)
 * @**tonioexp**
 * So what code did you change exactly? Was it this?
    `$filename = $_SERVER['DOCUMENT_ROOT'].'/
   wp-content/plugins/gallery-slider/register.txt';`
 * to this?
    `$pathtoplugin = plugin_dir_path(__FILE__ ) . '/wp-content/plugins/
   gallery-slider/register.txt';`
 * And every other place that `$_SERVER['DOCUMENT_ROOT']` occurs and just replace
   that with `$pathtoplugin = plugin_dir_path(__FILE__ );`
 * Thanks for your help. Your solution seems absolutely logical since my test site
   is in a subfolder like this: `http://mysite.com/wp/`
 * Peter
 *  Thread Starter [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * (@hardpeter4u)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543535)
 * @**lisabeewd**
    I meant the above post for YOU. Sorry I labeled it incorrectly.
 * If you’re there, can you see if you can answer please.
    Thanks Peter

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Error–Register.txt’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gallery-slider_9b8958.svg)
 * [Slider](https://wordpress.org/plugins/gallery-slider/)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-slider/reviews/)

## Tags

 * [missing file](https://wordpress.org/support/topic-tag/missing-file/)

 * 15 replies
 * 6 participants
 * Last reply from: [Peter](https://wordpress.org/support/users/hardpeter4u/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/error-registertxt/#post-4543535)
 * Status: not resolved