- Saved searches
- Use saved searches to filter your results more quickly
- iNamik/PHP-Download-Tracker
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Как скачать файл в формате php с сайта?
- How to Fix WordPress Downloading Index.php Instead of Displaying Site
- Method to Fix WordPress Downloading Index.php
- Conclusion
- Similar Posts
- 15+ Best Stunning Model Agency WordPress Themes
- Easy Ways to Build a Landing Page in WordPress from Scratch
- How To Choose A Domain Name
- How To Fix Error 522 (Connection timed out) in WordPress
- How To Add New User Roles on Your WordPress Site?
- How To override wooCommerce cSS
- Leave a Reply Cancel reply
- 11 Comments
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
A Single PHP Script That Helps You Track Downloads From Your Site
iNamik/PHP-Download-Tracker
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Welcome to PHP Download Tracker
PHP Download Tracker is a single PHP script that helps you track downloads from your site.
You configure the script with an offline (or protected) folder that contains files available for download.
You can also configure a few display settings, including the ability to include a simple CAPTCHA
The script will present the user with a list of available files.
When the user selects a file, the request is logged and then the download window pups up in the user’s browser for them to save the file.
You can find the latest version at the Project Homepage
- Copy the PHP script into a web-accessible folder. The default script name is ‘index.php’ so that the webserver will automatically load the file when users enter the public download folder. You can name it something else if you plan on linking to it directly within your site.
- Edit the file and check the «Config Section» for customizable options.
- If you want logging enabled, make sure that the configured ‘logDir’ is writable by the webserver.
- You should probably ensure that the configured directories are either Not web-accessible or protected against browser access. To protect a directory using apache, create a file inside the directory called «.htaccess» and give it the following contents:
order deny, allow deny from all
This project is a heavy modification (i.e. near-complete rewrite) of DocTrax’s Download Manager (link good as of 2008/03/02)
About
A Single PHP Script That Helps You Track Downloads From Your Site
Как скачать файл в формате php с сайта?
Добрый день, господа.
Меня интересует такой вопрос:
— есть файл в корне index.php, который доступен для пользователей, ПС и т.д.
— каким образом можно скачать данный index.php в оригинале, т.е. в таком виде, как он лежит на моем хостинге?
— Как скачать php-файл в исходнике с ЧУЖОГО сайта через браузер или другую фичу?
Без доступа к файловой системе сервера — никак
Иначе бы такая дыра в уязвимости была.. . что смысла в php не было бы никакого.
в исходнике скачать php файл с чужого сайта можно через фичу ftp, ssh =)
браузеры тоже поддерживают протокол ftp
как Вам удалось её получить?
проверяю у себя.
в моём случае (корневая папка поддомена):
. /
. index.php
. index.html
по клику на ссылку появляется диалоговое окно «Сохранить как» и при подтверждении скачивается на ура.
Ребята очнитесь! В таком виде: link
вы скачаете php файл, но его содержимое будет являться html кодом, который отображается в браузере при открытом index.php.
header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=index.php'); header('Content-Length: ' . filesize(__FILE__)); readfile(__FILE__); exit;
How to Fix WordPress Downloading Index.php Instead of Displaying Site
“WordPress downloads a compressed file instead of opening index.php or when i try to access my wp-admin”. This was a question asked to us by one of our readers and he wanted to know how to solve it. As I have no idea how was this happening so I kept the question aside in my questions list until it happened with my blog.
So this made me freak out as I lost access to my wp-admin, although I have a daily backup of my blog. But it’s not a choice to restore my blog as its a long list of work to be done and as for others, they don’t have a daily backup.
- Renaming my theme to old-[name-of-theme]
- Renaming plugin folder to old-plugins (to disable them all)
- Clearing the cache for Firefox, Safari, and Chrome.
Nothing worked.
I google and found some answers like
delete AddHandler application/x-httpd-php52 .php .php5 .php4 .php3
No idea how that got there! But I got my solution.
Disclosure: I may receive affiliate compensation for some of the links below at no cost to you if you decide to purchase a paid plan. You can read our affiliate disclosure in our privacy policy.
Method to Fix WordPress Downloading Index.php
But here’s what I did and It started working within 5 minutes and it was easy.
I accessed my .htaccess in cPanel and also kept a backup in case I messed the config codes. (Please Keep a backup).
If for any reason you can’t find .htaccess on your WordPress installation root directory, then Click File Manager and make sure to tick Show Hidden Files (dotfiles) and click Go.
The .htaccess should show up where wp (wp-admin, wp-content, wp-includes) is installed, which is your WordPress root directory.
I studied the code and I found some extra lines of code messing with my WordPress. I deleted the extra code and it started working.
For those who are not programmers for them follow the steps below:
- Open and edit .htaccess – Have a backup before editing
- Delete all the codes inside it
- Now copy the code below this and paste & save it
- It should be working now, you can access your WordPress admin.
Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %//s% ^www\.(.*)//((s)on|s.*)$ [NC] RewriteRule ^ http%3://%1% [L,R=307] AddType x-mapp-php5 .php # BEGIN WordPressRewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # add a trailing slash to /wp-admin RewriteCond % ^.*/wp-admin$ RewriteRule ^(.+)$ $1/ [R=301,L] # END WordPress
Hope this helps someone, and have a great day.
Conclusion
The reason why your index.php is downloaded is that of your caching plugin or feature in your host which adds a few lines of codes that makes your WordPress fast as it compresses the file but in some cases, wp-admin is also cached which makes it impossible to access.
So just edit your .htaccess and paste the above code given and your blog is again ready to rock
If you have any queries, feel free to ask below in the comments.
Niraj Kashyap, the go-to guy for all your digital tool needs! 🚀 With his extensive knowledge and expertise in the field, he passionately buys, tests, and reviews SAAS tools that are perfect for small businesses. 💼🔍. Niraj Kashyap’s content is an absolute hit, reaching millions of eager users every month. When he’s not busy being a full-time blogger and SEO expert, Niraj Kashyap dedicates his time to helping individuals like you build profitable blogs. 🏆💰 With his guidance, you too can achieve blogging success in no time! 💪🎉. Contact NirajKashyap.
Similar Posts
15+ Best Stunning Model Agency WordPress Themes
Easy Ways to Build a Landing Page in WordPress from Scratch
How To Choose A Domain Name
How To Fix Error 522 (Connection timed out) in WordPress
How To Add New User Roles on Your WordPress Site?
How To override wooCommerce cSS
Leave a Reply Cancel reply
11 Comments
Are you sure this code is legit, I mean when we go to WordPress.org and search htaccess it only shows basic coding?
Yes the code is legit. When you have a fresh copy of WordPress the .htaccess has only few lines. But after you install it, you will find that some more lines are automatically added by WordPress for Proper functioning. In this Problem, Every time you log into or access /wp-admin . It will download a file called index.php instead of the dashboard. This happens due to compressing of files by some caching plugin or server. This code overwrites everything to make wordpress work as normal like before. I hope this helps you, If your problem is solved by this method. Kindly let us know in the comments section. Thank you for your time and valuable feedback. Regards
Niraj
I had faced this problem many time but at the end, it solves automatically, but this it is happening again and again. I was using cache plugin for a long time I don’t think so it never occurs because of that but for making it clear, I deactivated it and I am still facing the same problem. It doesn’t happen frequently like continuing 2-3 days, it occurs for 15-20 mins then came back to normal state then the process continues.
For eg. if I am login to my WordPress and doing something like I am in plugins area, then this issue happens suddenly without doing anything, and then when I click on something for eg I clicked on the customization tab it starts downloading customize-PHP file. Or I open my site it starts downloading a file called *download* with nothing in that. I have the latest version of PHP and everything is up to date. I almost 15 articles on this problem. Please help me out with the solution. Thanks
Are you sure this code is legit, I mean when we go to WordPress.org and search htaccess it only shows basic coding?
Yes the code is legit. When you have a fresh copy of WordPress the .htaccess has only few lines. But after you install it, you will find that some more lines are automatically added by WordPress for Proper functioning. In this Problem, Every time you log into or access /wp-admin . It will download a file called index.php instead of the dashboard. This happens due to compressing of files by some caching plugin or server. This code overwrites everything to make wordpress work as normal like before. I hope this helps you, If your problem is solved by this method. Kindly let us know in the comments section. Thank you for your time and valuable feedback. Regards
Niraj
I had faced this problem many time but at the end, it solves automatically, but this it is happening again and again. I was using cache plugin for a long time I don’t think so it never occurs because of that but for making it clear, I deactivated it and I am still facing the same problem. It doesn’t happen frequently like continuing 2-3 days, it occurs for 15-20 mins then came back to normal state then the process continues.
For eg. if I am login to my WordPress and doing something like I am in plugins area, then this issue happens suddenly without doing anything, and then when I click on something for eg I clicked on the customization tab it starts downloading customize-PHP file. Or I open my site it starts downloading a file called *download* with nothing in that. I have the latest version of PHP and everything is up to date. I almost 15 articles on this problem. Please help me out with the solution. Thanks
Niraj this just worked for me, thanks my friend! I tried a few other fixes that I know of and nothing. Your fix got us back online thanks bunches!
Niraj this just worked for me, thanks my friend! I tried a few other fixes that I know of and nothing. Your fix got us back online thanks bunches!
i try this tipe but not work with me i change password Database and edit it in wp-config
and remove all in htaccess file
and add this only and it fixed
# BEGIN WordPress RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ — [L]
RewriteCond % !-f
RewriteCond % !-d
RewriteRule . /index.php [L] # END WordPress