TheJJ100100
Posts: 10
Joined: Sun Mar 16, 2014 8:12 pm

Apache Help-- Again

Mon Mar 17, 2014 4:43 pm

On this post http://www.raspberrypi.org/forum/viewto ... 36&t=72275 I could follow all the steps, but I couldn't do this command: find . -type=d | xargs chmod 755
or: find . -type=f | xargs chmod 644
Am I doing anything wrong?

Also, PHP isn't working
<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
echo "Hello World!";
?>

</body>
</html>

displays a blank screen.

lazarus78
Posts: 236
Joined: Thu Jul 25, 2013 5:16 pm

Re: Apache Help-- Again

Mon Mar 17, 2014 5:02 pm

I don't know what that command is trying to do, so I cant comment on that.

As far as the php goes, did you also install php? It isn't part of Apache, so you need to install it as well for the Pi to be able to process PHP code.

Also your page needs to be saved as a *.php and not an htm or html

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Apache Help-- Again

Mon Mar 17, 2014 5:06 pm

Why use xargs?

find . -type d -exec chmod 755 {} \;

As with most things *nix, there is no one right way to do something. Having said that, if xargs went away tomorrow, I would not notice.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

TheJJ100100
Posts: 10
Joined: Sun Mar 16, 2014 8:12 pm

Re: Apache Help-- Again

Mon Mar 17, 2014 5:08 pm

Lazarus78, I did install PHP5 and it i s saved ad a *.php file. As well, the command was:

by DougieLawson » Sun Mar 16, 2014 9:25 pm

sudo -i
cd /var/www
chown -R www-data.www-data *
find . -type=d | xargs chmod 755
find . -type=f | xargs chmod 644
exit

User avatar
rpdom
Posts: 15194
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Apache Help-- Again

Mon Mar 17, 2014 5:09 pm

As alreayd mentioned, you need to install libapache2-mod-php5 for PHP to work with Apache. Pages should end in .php, although you can fiddle things in the config files to get around that.

TheJJ100100
Posts: 10
Joined: Sun Mar 16, 2014 8:12 pm

Re: Apache Help-- Again

Mon Mar 17, 2014 5:10 pm

Now, the only problem is the php...

TheJJ100100
Posts: 10
Joined: Sun Mar 16, 2014 8:12 pm

Re: Apache Help-- Again

Mon Mar 17, 2014 5:11 pm

I can run phpBB3... just 192.168.0.42/index.php is not working...

Return to “Networking and servers”