Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Posts
    195

    How to change a PHP file permission

    In my VPS, I have the below file, that is not executing via web browser, I believe I have to set the permissionnot to root

    Code:
    -rw-r--r-- 1 root root   18 Feb  7 08:27 phpinfo.php
    Can you please let me know how to fix this?

  2. #2
    Join Date
    Sep 2008
    Location
    /dev/null
    Posts
    469
    if this a php info file then leave it and add a new ssh account login via putty and make a php info file and everything will be ok
    the file must be in the public_html dir
    Last edited by badboyx; 02-07-2014 at 10:00 AM.

  3. #3
    Quote Originally Posted by hostaq View Post
    In my VPS, I have the below file, that is not executing via web browser, I believe I have to set the permissionnot to root

    Code:
    -rw-r--r-- 1 root root   18 Feb  7 08:27 phpinfo.php
    Can you please let me know how to fix this?
    You will have to update the ownership and not the permissions. First change the directory where the file is uploaded. Use the command below.

    chown cPanel-user.cPanel-user phpinfo.php

    Replace cPanel-user with actual cPanel user.
    █ MilesWeb.com - Your Hosting, Our Responsibility!
    cPanel Hosting | Reseller Hosting | WordPress Hosting: SSD Storage & One-click Staging
    VPS Hosting - Managed & Unmanaged KVM & OpenVZ VPS | VPS Reseller
    █ Hosting Servers in [India | UK | US | Romania] - 24/7 Support | Instant Setup | Data Migration

  4. #4
    Join Date
    Jul 2004
    Posts
    195
    Quote Originally Posted by MilesWeb View Post
    You will have to update the ownership and not the permissions. First change the directory where the file is uploaded. Use the command below.

    chown cPanel-user.cPanel-user phpinfo.php

    Replace cPanel-user with actual cPanel user.
    Thanks for the info. I don't have cPanel

  5. #5
    Join Date
    May 2013
    Location
    India
    Posts
    748
    Initially, when you say you cannot run it via browser, what error are you getting? Also what is the content of the php file?

  6. #6
    Join Date
    Jul 2004
    Posts
    195
    Quote Originally Posted by nixtree View Post
    Initially, when you say you cannot run it via browser, what error are you getting? Also what is the content of the php file?
    When I try with browser, the php file get downloaded

  7. #7
    Join Date
    May 2013
    Location
    India
    Posts
    748
    That means PHP handler is not set on your server and your web server doesn't know how to handle PHP extension. Did you install PHP on your server? What OS are you using?

  8. #8
    Join Date
    Jul 2004
    Posts
    195
    Quote Originally Posted by nixtree View Post
    That means PHP handler is not set on your server and your web server doesn't know how to handle PHP extension. Did you install PHP on your server? What OS are you using?
    I installed CentOS 5.x with http://www.hiawatha-webserver.org/ webserver

  9. #9
    Join Date
    May 2013
    Location
    India
    Posts
    748
    I have never tried Hiawatha! But the error is due to the web server do not know what to do with .php files. Anyway check the following URLs to configure PHP with your websites,

    http://www.hiawatha-webserver.org/howto/cgi_and_fastcgi
    http://www.hiawatha-webserver.org/ho..._configuration

Similar Threads

  1. Replies: 1
    Last Post: 03-10-2006, 04:14 AM
  2. root can't change file permission
    By WebHostingNeeds in forum Hosting Security and Technology
    Replies: 4
    Last Post: 02-11-2006, 04:51 PM
  3. PHP file permission
    By raulgonzalez in forum Programming Discussion
    Replies: 1
    Last Post: 09-05-2003, 11:37 PM
  4. Modifying file permission usinga PHP script
    By talash in forum Hosting Security and Technology
    Replies: 3
    Last Post: 09-22-2002, 12:54 PM
  5. How to change file access permission?
    By Pluto in forum Hosting Security and Technology
    Replies: 3
    Last Post: 11-27-2001, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •