Re: Hard link shows php source code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No. It will output the source code. You can make it executable and add
#!/usr/bin/php
to the top of the file and it will execute using /usr/bin/php if it's setup as some form of CGI.

However, you probably do not want this.

A hard link is just another pointer to the same file on the same file system. So, to any application it behaves as if it were a copy but it is identical. You can setup handlers for files that execute them as PHP for any extension or probably even any file in the php-fpm/fcgi/module configuration.

Maybe you want a nice looking URL such as

https://my.web.com/mypath/myendpoint

If you want this you could either use Apache RewriteRule, Nginx equivalent or simply store it in
/webroot/mypath/myendpoint/index.php

Hope this helps.
Tim

On Wed, 30 Jan 2019, 18:27 Jeffry Killen <jekillen@xxxxxxxxxxx wrote:

> On Jan 29, 2019, at 8:46 PM, Sam Hobbs <Sam@xxxxxxxxxxxxxxxxxx> wrote:
>
>
>
> Jeffry Killen wrote on 1/29/2019 8:35 PM:
>> The ''situation" is when a hard link name without a .php suffix is to
>> a php script file that is recognized by .php suffix.
>>
> Recognized how? What is to be done with it? When you say "is recognized by .php suffix" do you mean that the file having a php suffix is to be processed as a PHP file? Do you want that to happen for all files having a php suffix?
>
> The original question said "the php source code was displayed". Is that what you want to happen or not happen? The relevance of the php source code being displayed is not clear.

Will a link to a php source code file that is named without a php suffix be considered and run as a php source code file?
I hope this clears it up. I don't know how I can clarified further.
JK


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux