Implementing index.php that serves index.htmlArch Linux: Apache just isn't interpreting the index.php...
Why are notes ordered like they are on a piano?
Field Length Validation for Desktop Application which has maximum 1000 characters
Floor tile layout process?
Stark VS Thanos
I caught several of my students plagiarizing. Could it be my fault as a teacher?
Survey Confirmation - Emphasize the question or the answer?
Transfer over $10k
Map one pandas column using two dictionaries
Historically, were women trained for obligatory wars? Or did they serve some other military function?
Does the Darkness spell dispel the Color Spray and Flaming Sphere spells?
Why is Arya visibly scared in the library in S8E3?
Junior developer struggles: how to communicate with management?
Pressure to defend the relevance of one's area of mathematics
Why is the SNP putting so much emphasis on currency plans?
Was Unix ever a single-user OS?
How to reply this mail from potential PhD professor?
Short story about people living in a different time streams
How did Arya manage to disguise herself?
CRT Oscilloscope - part of the plot is missing
How to creep the reader out with what seems like a normal person?
What was the state of the German rail system in 1944?
Why do computer-science majors learn calculus?
Meaning of "individuandum"
Packet sniffer for MacOS Mojave and above
Implementing index.php that serves index.html
Arch Linux: Apache just isn't interpreting the index.php filesnginx php-fpm index.php doesn't loadindex.html is not working in apache document rootWhy thepiratebay.se showing the content of /var/www/index.html?nginx serves info.php but doesn't serve index.phpMy index.html not in DocumentRootWhy apache2 is rendering only index.htmlConfiguring Systemd to execute extra script after httpd start/restart using ExecStartPost setting not workingRunning Bash Script in a Browser Even with Apache Permissions SetIs plain text in index.html secure?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I want a webpage to reflect a log file. I have a bash script that converts the log to html. Currently this runs periodically via crontab, which works, but obviously executions are redundant when the webpage isn't viewed. I'd like to implement a system so the bash script runs only called when the webpage is called.
I gather an index.php script along the lines:
<?php
$message=shell_exec(". /path/script.sh");
?>
.. should generate the index.html
file ok. But is there an easy way to get index.php/Apache to serve that file to the client browser?
apache-httpd php
add a comment |
I want a webpage to reflect a log file. I have a bash script that converts the log to html. Currently this runs periodically via crontab, which works, but obviously executions are redundant when the webpage isn't viewed. I'd like to implement a system so the bash script runs only called when the webpage is called.
I gather an index.php script along the lines:
<?php
$message=shell_exec(". /path/script.sh");
?>
.. should generate the index.html
file ok. But is there an easy way to get index.php/Apache to serve that file to the client browser?
apache-httpd php
1
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25
add a comment |
I want a webpage to reflect a log file. I have a bash script that converts the log to html. Currently this runs periodically via crontab, which works, but obviously executions are redundant when the webpage isn't viewed. I'd like to implement a system so the bash script runs only called when the webpage is called.
I gather an index.php script along the lines:
<?php
$message=shell_exec(". /path/script.sh");
?>
.. should generate the index.html
file ok. But is there an easy way to get index.php/Apache to serve that file to the client browser?
apache-httpd php
I want a webpage to reflect a log file. I have a bash script that converts the log to html. Currently this runs periodically via crontab, which works, but obviously executions are redundant when the webpage isn't viewed. I'd like to implement a system so the bash script runs only called when the webpage is called.
I gather an index.php script along the lines:
<?php
$message=shell_exec(". /path/script.sh");
?>
.. should generate the index.html
file ok. But is there an easy way to get index.php/Apache to serve that file to the client browser?
apache-httpd php
apache-httpd php
edited 1 hour ago
Rui F Ribeiro
42.5k1485146
42.5k1485146
asked Apr 30 '15 at 16:03
geotheorygeotheory
167111
167111
1
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25
add a comment |
1
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25
1
1
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25
add a comment |
3 Answers
3
active
oldest
votes
I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html
.
add a comment |
I gather the best solution is to end the php with:
header('Location: index.html');
exit;
add a comment |
Another option:
Create an .htaccess
file in your web server root with the following:
AddType application/x-httpd-php .htm .html
Now apache will process .htm
and .html
files as php documents and any <?php ... ?>
tags located in that file will be interpreted as php.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f199669%2fimplementing-index-php-that-serves-index-html%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html
.
add a comment |
I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html
.
add a comment |
I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html
.
I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html
.
answered Apr 30 '15 at 16:22
Ulrich SchwarzUlrich Schwarz
10.2k13249
10.2k13249
add a comment |
add a comment |
I gather the best solution is to end the php with:
header('Location: index.html');
exit;
add a comment |
I gather the best solution is to end the php with:
header('Location: index.html');
exit;
add a comment |
I gather the best solution is to end the php with:
header('Location: index.html');
exit;
I gather the best solution is to end the php with:
header('Location: index.html');
exit;
answered May 1 '15 at 11:50
geotheorygeotheory
167111
167111
add a comment |
add a comment |
Another option:
Create an .htaccess
file in your web server root with the following:
AddType application/x-httpd-php .htm .html
Now apache will process .htm
and .html
files as php documents and any <?php ... ?>
tags located in that file will be interpreted as php.
add a comment |
Another option:
Create an .htaccess
file in your web server root with the following:
AddType application/x-httpd-php .htm .html
Now apache will process .htm
and .html
files as php documents and any <?php ... ?>
tags located in that file will be interpreted as php.
add a comment |
Another option:
Create an .htaccess
file in your web server root with the following:
AddType application/x-httpd-php .htm .html
Now apache will process .htm
and .html
files as php documents and any <?php ... ?>
tags located in that file will be interpreted as php.
Another option:
Create an .htaccess
file in your web server root with the following:
AddType application/x-httpd-php .htm .html
Now apache will process .htm
and .html
files as php documents and any <?php ... ?>
tags located in that file will be interpreted as php.
edited May 1 '15 at 12:48
answered May 1 '15 at 12:32
datUserdatUser
2,7491236
2,7491236
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f199669%2fimplementing-index-php-that-serves-index-html%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Why not use [a modified version of] your bash script as a CGI instead of a PHP proxy?
– user86969
Apr 30 '15 at 16:25