Click here to Skip to main content
15,897,090 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerCentOS httpd can not access Symbolink Pin
njzt28-Dec-16 1:26
njzt28-Dec-16 1:26 
Hi all,
I got a problem

I used CentOS 7.1,
used command: yum -y install httpd to install apahce
used command: yum -y install php to install php

noting to change the configure file /etc/httpd/conf/httpd.conf

and then I have done this two things in /var/www/html/:

1. ln -s /home/ninja/workspace/storage .

2. create a test file test.php

PHP
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# ls
storage  test.php
[root@localhost html]# ll
total 4
lrwxrwxrwx 1 root root  29 Dec 28 20:05 storage -> /home/ninja/workspace/storage
-rwxr-xr-x 1 root root 122 Dec 28 20:04 test.php
[root@localhost html]# cat test.php
<?php

	echo "====================\n";
	$data = file_get_contents("./storage/8010252");
	echo "get data";
	echo $data;
?>

the file 8010252 does really there, but php can not access.
the apache error log shows:
PHP
[Wed Dec 28 20:06:46.858835 2016] [:error] [pid 8605] [client 192.168.3.57:26918] PHP Warning:  file_get_contents(./storage/8010252): failed to open stream: No such file or directory in /var/www/html/test.php on line 4


If I don't use Symbolink, it works, it seems like apache can not access the Symbolink folder.

Anyone can help, Thanks a lot.



Solution:
To solve this problem, I just run the command:
chmod -R +x /home/ninja


and then it works!

modified 28-Dec-16 21:15pm.

QuestionOpen Suse Linux Pin
ForNow27-Dec-16 13:42
ForNow27-Dec-16 13:42 
AnswerRe: Open Suse Linux Pin
Richard MacCutchan27-Dec-16 21:00
mveRichard MacCutchan27-Dec-16 21:00 
GeneralRe: Open Suse Linux Pin
ForNow28-Dec-16 2:11
ForNow28-Dec-16 2:11 
GeneralRe: Open Suse Linux Pin
Richard MacCutchan28-Dec-16 5:45
mveRichard MacCutchan28-Dec-16 5:45 
AnswerRe: Open Suse Linux Pin
Albert Holguin9-Jan-17 7:52
professionalAlbert Holguin9-Jan-17 7:52 
QuestionWhich is the Best Laravel Admin Template with all the advanced functionalities? Pin
Rakeshroshans23-Dec-16 20:00
Rakeshroshans23-Dec-16 20:00 
AnswerRe: Which is the Best Laravel Admin Template with all the advanced functionalities? Pin
Richard MacCutchan23-Dec-16 21:55
mveRichard MacCutchan23-Dec-16 21:55 
Questionfail to run php script as shell Pin
njzt6-Dec-16 15:36
njzt6-Dec-16 15:36 
SuggestionRe: fail to run php script as shell Pin
Richard MacCutchan6-Dec-16 22:03
mveRichard MacCutchan6-Dec-16 22:03 
QuestionDatabase connection refused. Pin
taiwokaffo6-Dec-16 4:16
taiwokaffo6-Dec-16 4:16 
QuestionRe: Database connection refused. Pin
Richard MacCutchan6-Dec-16 4:27
mveRichard MacCutchan6-Dec-16 4:27 
AnswerRe: Database connection refused. Pin
taiwokaffo6-Dec-16 4:45
taiwokaffo6-Dec-16 4:45 
GeneralRe: Database connection refused. Pin
Eddy Vluggen6-Dec-16 4:58
professionalEddy Vluggen6-Dec-16 4:58 
GeneralRe: Database connection refused. Pin
taiwokaffo6-Dec-16 23:06
taiwokaffo6-Dec-16 23:06 
QuestionPHP topic selection for Final year Project Pin
Member 1278820324-Nov-16 2:51
Member 1278820324-Nov-16 2:51 
GeneralRe: PHP topic selection for Final year Project Pin
Kornfeld Eliyahu Peter24-Nov-16 5:08
professionalKornfeld Eliyahu Peter24-Nov-16 5:08 
AnswerRe: PHP topic selection for Final year Project Pin
Richard MacCutchan24-Nov-16 6:37
mveRichard MacCutchan24-Nov-16 6:37 
GeneralRe: PHP topic selection for Final year Project Pin
Member 127882035-Dec-16 22:17
Member 127882035-Dec-16 22:17 
GeneralRe: PHP topic selection for Final year Project Pin
Member 127882036-Dec-16 22:35
Member 127882036-Dec-16 22:35 
QuestionSeveral arrays to one multidimensional Pin
Member 128309193-Nov-16 5:29
Member 128309193-Nov-16 5:29 
AnswerRe: Several arrays to one multidimensional Pin
WildDonkey11-Feb-17 3:59
WildDonkey11-Feb-17 3:59 
QuestionOOP in PHP Pin
Member 1278820328-Oct-16 4:22
Member 1278820328-Oct-16 4:22 
AnswerRe: OOP in PHP Pin
Anurag Gandhi13-Nov-16 6:09
professionalAnurag Gandhi13-Nov-16 6:09 
GeneralRe: OOP in PHP Pin
Peter_in_278013-Nov-16 13:38
professionalPeter_in_278013-Nov-16 13:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.