You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



How to remove Execute option from right click for php files

Author (Read 4354 times)

0 Members and 1 Guest are viewing this topic.

Re: How to remove Execute option from right click for php files
« Reply #10 on: November 13, 2019, 11:49:19 PM »
 

jerryc

  • New to Forums
  • *
  • 41
    Posts
  • Reputation: 0
  • LL user - Old xubuntu user
    • View Profile
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: [Select]
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.
jerryc, not to be confused with the real Jerry who developed this distro.
 

Re: How to remove Execute option from right click for php files
« Reply #9 on: November 13, 2019, 06:22:21 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
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.
 

Re: How to remove Execute option from right click for php files
« Reply #8 on: November 13, 2019, 05:04:04 PM »
 

bahmanjalal

  • New to Forums
  • *
  • 4
    Posts
  • Reputation: 0
  • Linux Lite Member
    • View Profile
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.
 

Re: How to remove Execute option from right click for php files
« Reply #7 on: November 08, 2019, 02:50:35 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
You need to be owner of ntfs partitions to change perms.

Code: [Select]
sudo chown -R future:future /media/future/files/
Code: [Select]
sudo chown -R future:future /media/future/film/
then you can:

Code: [Select]
chmod -x /path/to/phpfiles/*.php
 

Re: How to remove Execute option from right click for php files
« Reply #6 on: November 08, 2019, 01:07:22 PM »
 

bahmanjalal

  • New to Forums
  • *
  • 4
    Posts
  • Reputation: 0
  • Linux Lite Member
    • View Profile
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 :

On those partitions, I can't disable execute permission. When I do these commend :
Code: [Select]
sudo chmod -x /media/ -Rall 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.
 

Re: How to remove Execute option from right click for php files
« Reply #5 on: November 07, 2019, 02:38:11 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
chmod -x filename.php or chmod -x *.php for all php files in that directory.
 

Re: How to remove Execute option from right click for php files
« Reply #4 on: November 07, 2019, 01:41:15 PM »
 

bahmanjalal

  • New to Forums
  • *
  • 4
    Posts
  • Reputation: 0
  • Linux Lite Member
    • View Profile
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.
 

Re: How to remove Execute option from right click for php files
« Reply #3 on: November 07, 2019, 09:52:33 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Change the permissions to non-executable.

Sent from my Mobile phone using Tapatalk

 

Re: How to remove Execute option from right click for php files
« Reply #2 on: November 07, 2019, 09:34:17 AM »
 

trinidad

  • Platinum Level Poster
  • **********
  • 1463
    Posts
  • Reputation: 212
  • Linux Lite Member
    • View Profile
    • dbts-analytics.com

  • CPU: i7 4 cores 8 threads

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD graphics

  • Kernel: 5.x
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
All opinions expressed and all advice given by Trinidad Cruz on this forum are his responsibility alone and do not necessarily reflect the views or methods of the developers of Linux Lite. He is a citizen of the United States where it is acceptable to occasionally be uninformed and inept as long as you pay your taxes.
 

How to remove Execute option from right click for php files
« Reply #1 on: November 07, 2019, 05:26:59 AM »
 

bahmanjalal

  • New to Forums
  • *
  • 4
    Posts
  • Reputation: 0
  • Linux Lite Member
    • View Profile
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 :

Atom editor didn't set to default. All time i must use of "open with" on right click action.
Thanks :)
« Last Edit: December 01, 2019, 08:55:19 PM by firenice03 »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section