Maison > développement back-end > tutoriel php > ubuntu 1404 nginx php

ubuntu 1404 nginx php

WBOY
Libérer: 2016-07-29 09:02:36
original
764 Les gens l'ont consulté

打开/etc/nginx/sites-available中的default文件进行修改

<code><span>#添加一个index.php</span>
server {
    <span>listen</span><span>80</span> default_server;
    <span>listen</span> [::]:<span>80</span> default_server ipv6

    root /usr/share/nginx/html;
    <span>index</span><span>index</span>.php <span>index</span>.html <span>index</span>.htm; <span>#添加</span><span># Make site accessible from http://localhost/</span>
    server_name localhost;

    location / {
        <span># First attempt to serve request as file, then</span><span># as directory, then fall back to displaying a 404.</span>
        try_files <span>$uri</span><span>$uri</span>/ =<span>404</span>;
        <span># Uncomment to enable naxsi on this location</span><span># include /etc/nginx/naxsi.rules</span>
    }
</code>
Copier après la connexion

注释掉一些东西

<code>    location ~ \<span>.php</span>$ {
         fastcgi_split_path_info ^(.+\<span>.php</span>)(/.+)$<span>;</span><span># NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini</span><span># With php5-cgi alone:</span><span>#fastcgi_pass 127.0.0.1:9000;</span><span># With php5-fpm:</span><span>#fastcgi_param SCRIPT_FILENAME /path$fastcgi_script_name;</span>
        fastcgi_pass unix:/var/run/php5-fpm<span>.sock</span><span>;</span>
        fastcgi_index index<span>.php</span><span>;</span>
        include fastcgi_params<span>;</span>
    }
</code>
Copier après la connexion

大功告成

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了ubuntu 1404 nginx php,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal