Linux Lite Forums

Full Version: How to remove Execute option from right click for php files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.
I hope you be fine.
I have a problem for PHP files.
I set Atom editor for PHP files but when i put enter on PHP files, they didn't open because they can open just with execute option.
See on bellow pic :
[Image: Screenshot-2019-11-07-13-33-55.png]
Atom editor didn't set to default. All time i must use of "open with" on right click action.
Thanks Smile
Not sure what you are attempting to do here, and your image does not display enough info,  but you wouldn't want atom to be the default application for opening php files from Thunar. You don't need Thunar to look for your files as atom finds it's own files with >File >Open from the menu bar, however it won't find a file that is not in a folder, which means you shouldn't save your files to your home directory, i/e create a folder in your home directory named ~/atomproject1 or something like that and save your project files there. Then you will be able to open them directly from atom.
TC
Change the permissions to non-executable.

Sent from my Mobile phone using Tapatalk

Hello again.
Thanks a lot for your help.
I do these :
sudo chown future:future test.php
sudo chmod a-x test.php
sudo chmod 777 test.php
But this php file is executable yet !
I do wrong ?
Thanks a lot.
chmod -x filename.php or chmod -x *.php for all php files in that directory.
Hello again.
Thanks a lot for your help.
I checked and in Home directory no problem for PHP files.
I use of NTFS partition on my HDD and I changed NTFS partition with " gksudo ntfs-config "  command that you can see below :
[Image: gksudo.png]
On those partitions, I can't disable execute permission. When I do these commend :
Code:
sudo chmod -x /media/ -R
all files and folder will be hidden and I must change permission to 755 for media folder for unhidden all things.
Just I have problem for disabling execute on my NTFS partitions.
Thanks a lot for your guide.
You need to be owner of ntfs partitions to change perms.

Code:
sudo chown -R future:future /media/future/files/

Code:
sudo chown -R future:future /media/future/film/

then you can:

Code:
chmod -x /path/to/phpfiles/*.php
Hello and thanks a lot for your guide .
I did it and i get error "Read-only file system" for all files. For example :
chown: changing ownership of '/media/future/files/VProRecovery/VProRecoveryStorage.ini': Read-only file system.
I think an action is active and don't allow me to change permission and user group.
Thanks again.
I don't think you should be trying to change perms on a Recovery partition, they need to stay as they are. Be selective about what you change perms on, eg. nothing related to Windows. Not saying it can't be done, just best practice not to.
I've had similar problems with using .php files.

First of all, I agree with the real Jerry -- don't work with the recovery disk. Copy the PHP files you want to work with to someplace else.

Then, when you need to use them, here's a hack that worked for me:

Bulk rename to all those archived *.php files to *.php.txt (for example, or some other hack that works for you). A .txt file normally won't be executable, no matter what's in it. If they still keep their executable permissions, you can navigate to the directory and run:

Code:
chmod 664 ./*.php.txt

... or whatever permissions you want to set.

If you need code highlighting in your text editor, edit your editor's view preferences so such files display just like .php files.

Then, when you actually need to use the files, rename them back to .php. Alternatively, if you're including them into other .php files with an include or require call, you may be able to just include them as named. I've included many files without .php suffixes into .php files, and had all the included text executed as PHP code. YMMV.