Viewed k times. OS and server information: CentOS 6. Thank you. EDIT: I have these lines in the php. Improve this question. Anthony Gainor. Anthony Gainor Anthony Gainor 1, 2 2 gold badges 9 9 silver badges 9 9 bronze badges. Well, how did you install it? Which SAPI? Your php module is not running. I edited the questions. The modules do exits and they are being loaded apparently — Anthony Gainor.
Did you restart apache after installation? Show 6 more comments. Active Oldest Votes. Improve this answer. Mihkel Mihkel 6 6 silver badges 2 2 bronze badges. Could you add some info where to put these lines? For people looking for where to put these lines.
In my case , on Apache This works, adding d part to x-http-php like on your post works! I've configured php from source — Liso. Add a comment. So here is another possible cause: If you have something like AddHandler x-mapp-php6.
I had the some problem but found the culprit. If anyone else has the same issue, look for. I had an. It was forcing a version of PHP that was not installed on my local machine. Thus the virtual host wasn't executing the PHP file properly.
This is almost certainly the problem if some sites work and others don't. Show 1 more comment. After struggling a lot I finally solved the problem. But If you are still getting the error : Config file php5.
Ravi Shankar Ravi Shankar 1 1 silver badge 5 5 bronze badges. Note that this only works under Linux and specifically Debian Linux. Please take a look at your addtype directives. Clearing your browser cache is always a good idea. AddHandler php5-script.
DirectoryIndex index. Sam Azer Sam Azer 3 3 bronze badges. This is perfect for files like PDFs, document files, images, and video that you want your customers to download rather than read online. Line two forces browser to download file by defining the Content-Type. The fourth line sends the filename to save using Content-disposition. Finally the fith line outputs the file content to begin the download stream.
Pretty Interesting post. It could not be written any better. Create a free Team What is Teams? Learn more. How to configure Apache2 to download files directly? Ask Question. Asked 6 years, 7 months ago. Active 6 years, 7 months ago. Viewed 29k times. In the file, I had this string: This is a test file. Improve this question. Lightn1ng Lightn1ng 1 1 gold badge 2 2 silver badges 5 5 bronze badges.
Add a comment. Active Oldest Votes. Improve this answer. Community Bot 1. Browsers offer to download files based on two headers: Content-Type Content-Disposition I use a command line tool called curl to check headers on a website.
Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast what if you could invest in your favorite developer? Who owns this outage?
Building intelligent escalation chains for modern SRE. Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.
0コメント