Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MarkAtia's avatar

parsing vanilla php files without .php extensions under Homestead

Hi,

I have a few pure vanilla php projects that I would like to move across to my Homestead environment. How can I configure nginx (sites available) to parse the php files without the .php extension? Currently all files shows the index.php content, so visiting hello.dev/info shows the content of hello.dev. Any help would be great.

0 likes
2 replies
fideloper's avatar

What's your current nginx config? Paste that here and we can help adjust it.

MarkAtia's avatar

Hi @fideloper, its the standard Homestead 1.0.1 nginx configuration.

server { listen 80; listen 443 ssl; server_name mcds.dev; root "/home/vagrant/Code/mcds";

index index.html index.htm index.php;

charset utf-8;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/mcds.dev-error.log error;

sendfile off;

client_max_body_size 100m;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_intercept_errors off;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
}

location ~ /\.ht {
    deny all;
}

ssl_certificate     /etc/nginx/ssl/mcds.dev.crt;
ssl_certificate_key /etc/nginx/ssl/mcds.dev.key;

}

Please or to participate in this conversation.