Prev: How verify whether browser arrived via IPv6, IPv4, domain or number
Next: Regular expressions, filter option1 OR option2
From: e-letter on 18 Aug 2010 06:47 On 18/08/2010, chris h <chris404(a)gmail.com> wrote: > php is not processing the file. There's a few reasons for this, but the > first thing I would check is the permissions of the file. From the > directory try > > $ ls -oa > The file permission was confirmed as root, since it was copied (as root) from a normal user account directorp 'temporary' to the directory '/var/www/html' > This should tell you who owns the file and what it's permissions are. You > mentioned that you copied it as root, you could change it's ownership to > www-data. > This fails: [root(a)localhost html]# chown www-data test.php chown: `www-data': invalid user So I repeated this with a normal user account and the change in permission occurs. However, the html file containing the php script remains unchanged. The instruction: .... <?php phpinfo() ?> .... Does not show the version of php.
From: Peter Lind on 18 Aug 2010 06:53 On 18 August 2010 12:47, e-letter <inpost(a)gmail.com> wrote: > On 18/08/2010, chris h <chris404(a)gmail.com> wrote: >> php is not processing the file. Â There's a few reasons for this, but the >> first thing I would check is the permissions of the file. Â From the >> directory try >> >> $ ls -oa >> > The file permission was confirmed as root, since it was copied (as > root) from a normal user account directorp 'temporary' to the > directory '/var/www/html' > >> This should tell you who owns the file and what it's permissions are. Â You >> mentioned that you copied it as root, you could change it's ownership to >> www-data. >> > This fails: > > [root(a)localhost html]# chown www-data test.php > chown: `www-data': invalid user > > So I repeated this with a normal user account and the change in > permission occurs. However, the html file containing the php script > remains unchanged. > > The instruction: > > ... > <?php phpinfo() ?> > ... > > Does not show the version of php. > Your webserver might not be configured to process php files - which server are you using? Regards Peter -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 </hype>
From: e-letter on 18 Aug 2010 06:58 On 18/08/2010, Peter Lind <peter.e.lind(a)gmail.com> wrote: > On 18 August 2010 12:47, e-letter <inpost(a)gmail.com> wrote: >> On 18/08/2010, chris h <chris404(a)gmail.com> wrote: >>> php is not processing the file. There's a few reasons for this, but the >>> first thing I would check is the permissions of the file. From the >>> directory try >>> >>> $ ls -oa >>> >> The file permission was confirmed as root, since it was copied (as >> root) from a normal user account directorp 'temporary' to the >> directory '/var/www/html' >> >>> This should tell you who owns the file and what it's permissions are. >>> You >>> mentioned that you copied it as root, you could change it's ownership to >>> www-data. >>> >> This fails: >> >> [root(a)localhost html]# chown www-data test.php >> chown: `www-data': invalid user >> >> So I repeated this with a normal user account and the change in >> permission occurs. However, the html file containing the php script >> remains unchanged. >> >> The instruction: >> >> ... >> <?php phpinfo() ?> >> ... >> >> Does not show the version of php. >> > > Your webserver might not be configured to process php files - which > server are you using? > Apache. Below is an extract of an (to now) unanswered question: .... <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch Apparently this should be part of the addtype directive. I don't understand which file I am to edit and add the code shown above. .... So perhaps apache is not configured but I don't know how to test this.
From: chris h on 18 Aug 2010 06:58 What are the actual file permissions when you run ls -o? Do you know if PHP is installed as an apache mod or cgi? Also you might check what user apache is running as. possibly... $ vi /etc/apache2/envvars and look for something like... export APACHE_RUN_USER=www-data On Wed, Aug 18, 2010 at 6:47 AM, e-letter <inpost(a)gmail.com> wrote: > On 18/08/2010, chris h <chris404(a)gmail.com> wrote: > > php is not processing the file. There's a few reasons for this, but the > > first thing I would check is the permissions of the file. From the > > directory try > > > > $ ls -oa > > > The file permission was confirmed as root, since it was copied (as > root) from a normal user account directorp 'temporary' to the > directory '/var/www/html' > > > This should tell you who owns the file and what it's permissions are. > You > > mentioned that you copied it as root, you could change it's ownership to > > www-data. > > > This fails: > > [root(a)localhost html]# chown www-data test.php > chown: `www-data': invalid user > > So I repeated this with a normal user account and the change in > permission occurs. However, the html file containing the php script > remains unchanged. > > The instruction: > > ... > <?php phpinfo() ?> > ... > > Does not show the version of php. >
From: e-letter on 18 Aug 2010 07:10
On 18/08/2010, chris h <chris404(a)gmail.com> wrote: > What are the actual file permissions when you run ls -o? > root > > Do you know if PHP is installed as an apache mod or cgi? Also you might > check what user apache is running as. > No. How to verify? > possibly... > $ vi /etc/apache2/envvars > No apache2 on my computer, only '/usr/lib/apache' which contains only .so files. |