PDA

View Full Version : File permissions.



sepoto
9th March 2012, 09:27 AM
I am getting some very funny output from my console. I have tried to do some "chmod -R 755" to the files however nothing seems to be working out for me. The folder "html" and it's sub folders are owned by the user "penguin". Although clearly the files do exist and are 755 PHP does not see the files. What could be the problem here?



[root@Penguin-PC html]# ls -la
total 120
drwxr-xr-x. 4 penguin root 4096 Mar 9 00:24 .
drwxr-xr-x. 6 root root 4096 Mar 8 21:35 ..
-rwxr-xr-x 1 penguin penguin 128 Mar 8 21:48 info.php
-rwxr-xr-x 1 penguin penguin 547 Mar 7 20:22 login.php
drwxrwxr-x 3 penguin penguin 4096 Mar 8 21:47 nbproject
drwxr-xr-x 3 penguin penguin 4096 Mar 8 14:15 ns.phptoolkit
-rwxr-xr-x 1 penguin penguin 70031 Mar 7 20:21 PHPtoolkit.php
-rwxr-xr-x 1 penguin penguin 3713 Mar 7 20:21 sample_add_customer.php
-rwxr-xr-x 1 penguin penguin 121 Mar 8 22:39 sample_add_invoice.php
-rwxr-xr-x 1 penguin penguin 2423 Mar 8 15:32 sample_add_invoice.scrap.php
-rwxr-xr-x 1 penguin penguin 3057 Mar 7 20:42 sample_search_items.php
-rwxr-xr-x 1 penguin penguin 459 Mar 9 00:24 sandbox.php
-rwxr-xr-x 1 penguin penguin 431 Mar 9 00:21 sandbox.php~
[root@Penguin-PC html]# php sandbox.php
PHP Warning: Module 'xdebug' already loaded in Unknown on line 0
PHP Warning: require_once(directory_v2011.2.php): failed to open stream: No such file or directory in /var/www/html/PHPtoolkit.php on line 9
PHP Stack trace:
PHP 1. {main}() /var/www/html/sandbox.php:0
PHP 2. include() /var/www/html/sandbox.php:2
PHP Fatal error: require_once(): Failed opening required 'directory_v2011.2.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/PHPtoolkit.php on line 9
PHP Stack trace:
PHP 1. {main}() /var/www/html/sandbox.php:0
PHP 2. include() /var/www/html/sandbox.php:2
[root@Penguin-PC html]#


This is the contents of sandbox.php:



<?php
include('/var/www/html/PHPtoolkit.php');
include('/var/www/html/login.php');

global $myNSclient;

$itemId = "nd";
$itemSearch = new nsComplexObject("ItemSearchBasic");
$itemSearch->setFields(array("itemId" => array("operator" => "contains","searchValue" => $itemId)));
$myNSclient->setSearchPreferences(false, 10);

$searchResponse = $myNSclient->search($itemSearch);

if (!$searchResponse->isSuccess) {
echo "Alert Sepy! Search Success!";
}

?>

Fenrin
9th March 2012, 11:08 AM
does a file "directory_v2011.2.php" exist in the folder /var/www/html? I don't think that it is possible to include php files outisde of /var/www/html, but I'm not really sure.

sepoto
9th March 2012, 05:42 PM
You are quite right. The file PHPtoolkit.php was missing one of it's dependencies which needed to be in the same directory as PHPtoolkit.php. Thanks!