user image

Published in : 2022-03-01

How the image file have .php extension?

PHP & Mysql

As a newbie PHP developer, I was looking the website, with curiosity I was looking at the website thoughroly.

I saw one good-looking php logo and I inspected it with the google chrome developer console. That image address is like, 


How is it possible to have a .php extension for the image file? 

I see .jpg, .jpeg, .svg, .png etc… but .php is new for me!

I want to know how .php extension image works? what document type does it contain?



Shilpa Date : 2022-03-01

Best answers


Best answers


Yes, Everything is possible in the IT industry. Php allows any extension that doesn't really mean anything. You can keep .cartoon or no extension at all in any file.

As mentioned in the link, I observed a few things.


When .php is an image, it means the mime type depends on content-type, here it says image/png.

If you want to add the same, you can do it easily, for example - You are using apache httpd web server. Just update below line in your ‘httpd.conf’ or ‘.htaccess’ file under mime_module section.

AddType image/png .php

Hope this will clear your doubts.

You can read more here.

Link1: PHP Custom extension

Thanks for sharing the good observation, I never observed it.

Mohamed Atef Date : 2022-03-01

Great job

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

(Mysql) Count User's signing in activity based on daily login logs
Publish date: 2022-11-05 | Comments: 0

Tag: PHP & Mysql

phpmyadmin manual installation gives following error
Publish date: 2022-07-11 | Comments: 6

Tag: PHP & Mysql

SQL full languages table
Publish date: 2022-02-24 | Comments: 2

Tag: PHP & Mysql

Mysql query: How do I count the day streak of particular user?
Publish date: 2022-03-01 | Comments: 4

Tag: PHP & Mysql

[solved] Storage engine 'InnoDB' does not support system tables
Publish date: 2022-01-09 | Comments: 0

Tag: PHP & Mysql

ERROR 1410 (42000): You are not allowed to create a user with GRANT
Publish date: 2022-04-01 | Comments: 2

Tag: PHP & Mysql

change user root privelige and password
Publish date: 2022-02-23 | Comments: 1

Tag: PHP & Mysql