nginx不执行php文件

时间:2015-10-27 20:56:03

标签: php nginx

我在site的帮助下安装了nginx 当我去taskController.stopAllTasks它给我空屏幕。这是我的默认值:

http://localhost/index.php

它出了什么问题?

1 个答案:

答案 0 :(得分:0)

尝试使用php位置:

#include <iostream>
#include <fstream>
#include <iomanip>   // For formatted input
#include <cctype>    // For the "is" character functions
#include <cstring>   // For strncpy, strncat and strlen functions
#include <cstdlib>   // For exit function
using namespace std;

int main() {
  ifstream fin;      // Declare and name the input file stream object
  ofstream fout;     // Declare and name the output file stream object
  char in_file[51];  // Filename for the input file
  char out_file[56]; // Filename for the output file
  char c;            // Current character in the file

  cout << "Enter the filename of the input file: ";
  cin >> setw(51) >> in_file; //setting max length of file name

  strncpy(out_file, in_file, 50);

  strncat(out_file, ".norm", 50 - strlen(out_file));

  fin.open(in_file);
  if(fin.fail()) {
    cout << "Cannot open " << in_file << " for reading.\n";
    exit(1);
  }

  fout.open(out_file);
  if(fout.fail()) {
    cout << "Cannot open " << out_file << " for writing.\n";
    exit(1);
  }

  while(fin.get(c))
    {
/* commented this out to see if a switch statement would output differently

    if (isupper(c))
    {
       c=tolower(c);
        putchar(c);
    }
    if (c=='/n')
    {
        fout<< endl << endl;
    }
    if (c=='/t')
    {
        for(int i=0; i<9; i++)
            fout<<" ";
    }


*/


switch (c)
    {
        case '\t' :                         // replace 'tab' by '8 chars'
            fout << "        ";
            break;
        case '\n' :                        //replace 1 newline with 2 
            fout<<"\n"<<"\n";
            break;
        default:                            // use default case to proccess all data and
            if (isupper (c)) {           // test upper/lower-case.
                char c2 = tolower (c);
            fout << c2;
            } else {
                fout << c;
            }
    }
    fin >> noskipws >> c;               // read the next character
}

fin.close();
fout.close();
  cout << in_file << " has been normalized into " << out_file << endl;
  return(0);
}

然后重新加载nginx和php-fpm(如果你得到一个坏网关是一个php-fpm错误(重新加载它))