website with php #124102
Unanswered
strawbs1989
asked this question in
Programming Help
website with php
#124102
Replies: 4 comments 1 reply
-
HI @strawbs1989 , Try adding this header to set the MIME type for the header('Content-Type: text/html'); |
Beta Was this translation helpful? Give feedback.
1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I'm not using a server 😕 just normal php GitHub uploader notepad++ that's
it
…On Fri, 17 May 2024, 08:54 Ethan Tan, ***@***.***> wrote:
Apache Configuration:
Ensure you have a line like this in your Apache configuration:
AddType application/x-httpd-php .php
Also, ensure that the PHP module is loaded:
LoadModule php_module modules/libphp.so
Nginx Configuration:
Ensure that your server block includes something like:
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
Check for PHP Installation: Verify that PHP is installed on your server.
You can do this by running php -v in your terminal. If PHP is not
installed, you'll need to install it. For example, on Ubuntu, you can
install PHP with:
sudo apt update
sudo apt install php libapache2-mod-php
Restart the Server: After making any changes to the configuration files,
restart your web server to apply the changes.
For Apache:
sudo systemctl restart apache2
For Nginx:
sudo systemctl restart nginx
—
Reply to this email directly, view it on GitHub
<#124102 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYX4BFSLXPKBQJ7OXGSUDOLZCWZSBAVCNFSM6AAAAABHZ6WMICVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TINRXGE3TG>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
And I'm using windows
…On Fri, 17 May 2024, 08:54 Ethan Tan, ***@***.***> wrote:
Apache Configuration:
Ensure you have a line like this in your Apache configuration:
AddType application/x-httpd-php .php
Also, ensure that the PHP module is loaded:
LoadModule php_module modules/libphp.so
Nginx Configuration:
Ensure that your server block includes something like:
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
Check for PHP Installation: Verify that PHP is installed on your server.
You can do this by running php -v in your terminal. If PHP is not
installed, you'll need to install it. For example, on Ubuntu, you can
install PHP with:
sudo apt update
sudo apt install php libapache2-mod-php
Restart the Server: After making any changes to the configuration files,
restart your web server to apply the changes.
For Apache:
sudo systemctl restart apache2
For Nginx:
sudo systemctl restart nginx
—
Reply to this email directly, view it on GitHub
<#124102 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYX4BFSLXPKBQJ7OXGSUDOLZCWZSBAVCNFSM6AAAAABHZ6WMICVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TINRXGE3TG>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
General
Body
hi all i've recently uploaded my site with a html and php folder
for a project on my website, but everytime i refresh the site the php file keeps wanting to download?
now i personally think its something to do with this
`<?php
// Read requests from the flat file
$file = 'requests/requests.txt';
$requests = file_get_contents($file);
// Display requests
echo nl2br($requests); // Convert newlines to
tags for HTML display
?>`
i embed that code on my site but keeps wanting to download? its wierd
Beta Was this translation helpful? Give feedback.
All reactions