PogoPlug + PHP + Apache + Samba share

Ask questions about Arch Linux ARM. Please search before making a new topic.

PogoPlug + PHP + Apache + Samba share

Postby ConstantiusGallus » Wed Nov 23, 2011 8:24 pm

Hello,

I am new to this forum, PogoPlug and Linux in general. I apologize if this problem has been addressed in some form but I could not locate an answer via Google the last few hours. I was able to setup a PogoPlug v1 as an apache + PHP server.

***The following setup works fine in Ubuntu!!!!

I have a problem when I try to add samba to the mix. I mounted my time capsule share(holds media / html / scripts) to the following directory:

/srv/http/

It is mounted with fstab, cifs: options => user,exec, uid, gid where uid and gid are my user account and not root. On the console I CAN read/write my files. The permission is shown below for my user.

-drwxr-xr-x 1 <user> users Media ...

Also, I CAN remotely read and access the files via HTTP from my other machine. However, I can NOT execute the PHP files that are located under /srv/http.

If I don't mount using cifs/samba and simply copy files into /srv/http everything works fine(PHP included). I also mounted a share to a subfolder like /srv/http/media and tried to access the files via a PHP like /srv/http/test.php. The script ran but it could not access any of the folders / files mounted from the samba share.

Again, this simple setup worked fine on Ubuntu so I am stumped. I checked error logs in var ... etc. Nothing helpful... Can someone give me a hint? Thanks in advance.
ConstantiusGallus
 
Posts: 2
Joined: Wed Nov 23, 2011 8:01 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby WarheadsSE » Wed Nov 23, 2011 8:33 pm

I am guessing that php, running under Apache, is not in the group needed to execute the files.

note: I don't use Apache at home, so I can't speak to that directly, but that is the initial suspect.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby ConstantiusGallus » Wed Nov 23, 2011 10:43 pm

As an addendum ...

I tried interactive php.

1) I mounted my samba share to /srv/http/Media. The I ran this on the console:

php -r 'echo "Result: " . is_dir("/srv/http/Media") . "\n";'

Output => Result:

2) The I unmounted my samba share to /srv/http/Media. Ran the same command:

Output => Result: 1

3) Also tried the is_file which returned NULL and tried subdirectories like /srv/http/Media/Videos

So it looks like PHP does not recognize the samba folders or files correctly. Is this a bug? If so is it a PHP or samba or something else?
ConstantiusGallus
 
Posts: 2
Joined: Wed Nov 23, 2011 8:01 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby Raymondday » Thu Nov 24, 2011 7:31 am

This is what I had to do to get samba working and it works super good now. I posted it here on this link. I told like a easy step-by-step way.

-Raymond Day
Raymondday
 
Posts: 77
Joined: Sat Nov 19, 2011 1:46 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby WarheadsSE » Fri Nov 25, 2011 7:25 pm

That's not the problem he is having Raymondday, he's having issues getting PHP to access the files mounted from a different device's share.

If you having a matching config in Ubuntu that works, can you check the differences between memberships, ownerships and mount permissions?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby Raymondday » Fri Dec 02, 2011 6:59 pm

O yes. It's the same with my looks like Apache will not show index.php!

I have not found how to fix it.

-Raymond Day
Raymondday
 
Posts: 77
Joined: Sat Nov 19, 2011 1:46 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby pepedog » Fri Dec 02, 2011 7:56 pm

These 2 lines in httpd.conf are needed
LoadModule php5_module modules/libphp5.so
Include /etc/httpd/conf/extra/php5_module.conf
Then restart it
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: PogoPlug + PHP + Apache + Samba share

Postby Raymondday » Sat Dec 03, 2011 1:05 pm

I have Gallory 3 and phpBB3 installed. But when I go to there web pages the Gallory 3 can not be displayed even if I put /index.php/ on the end of the URL

The phpBB3 comes back as text the top lines like this:

$this->bbcode_second_pass_code('', '<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/')

That's in http://192.168.2.114/phpBB3/

But if I put index.php on the end of that it comes up.

So how can I tell Apache to auto load index.php like it does index.htm and index.html ?

All so I all ways have to put in it's IP number I can put it it's name "alarm" to go to it. I guess it's something how it's doing the hostname.

-Raymond Day
Raymondday
 
Posts: 77
Joined: Sat Nov 19, 2011 1:46 pm

Re: PogoPlug + PHP + Apache + Samba share

Postby kmihelich » Sat Dec 03, 2011 7:01 pm

You should find this page useful: https://wiki.archlinux.org/index.php/LAMP

You won't be able to put in "alarm" or whatever you change your hostname to without DNS assistance.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: PogoPlug + PHP + Apache + Samba share

Postby Raymondday » Sun Dec 04, 2011 9:38 am

I went to the LAMP set up link you gave and did all to get things I want running. I got all the way to the end of it.

After doing

$this->bbcode_second_pass_code('', '[root@alarm ~]# /etc/rc.d/httpd restart
:: Restarting Apache Web Server [DONE]
[root@alarm ~]#')

Then going to http://192.168.2.114/phpBB3/ I still get text. But if I put in http://192.168.2.114/phpBB3/index.php it works.

I have other Linux boxes were I can just put in there name and not IP to go to there LAN web page or samba folders. Is DNS assistance something I have to install in PogoPlug Pro?

-Raymond Day
Raymondday
 
Posts: 77
Joined: Sat Nov 19, 2011 1:46 pm

Next

Return to User Questions

Who is online

Users browsing this forum: No registered users and 5 guests