Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do not know why php is not working.

I install Nginx and php
enter image description here

  server {

  listen       80;
  server_name  t.com t.com;
  location ~ \.php$  {
   fastcgi_split_path_info ^(.+\.php)(/.+)$;
    root   /var/www/t.com/public_html/;
    index  index.html index.htm;
    try_files $uri $uri/ =404;
    }    error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   html;
  }

}

and php.conf

#s
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
AddType application/x-httpd-php  .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

and when browser  file  , show  download file
share|improve this question
    
There seems to be some extra stuff shown in php.conf, please tidy up the question to show what really is there. – zagrimsan Aug 3 '16 at 12:53

Your p.php file needs to start with:

<?php

and not

<?
share|improve this answer
    
good , but why do not run <? – Hussien Mhdi Aug 3 '16 at 12:58
1  
Welcome. Please accept the answer if you are happy with it. And to answer your question: Becasue short_open_tag is disabled in php.ini and it is also discouraged to keep it enabled. – user994144 Aug 3 '16 at 13:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.