You are not logged in.

#1 2014-10-21 06:03:00

mshan
Member
Registered: 2013-05-05
Posts: 105

[SOLVED] cann't set open_basedir in php.ini

I am trying to set open_basedir in php.ini.
I fallow wiki page: https://wiki.archlinux.org/index.php/LAMP
in my /etc/php/php.ini

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/home/mylinuxusername/public_html

I have test.php file in ~/public_html
how can I access that file in browser? (sorry! my question may be very stupid for you)
I do

http://localhost/home/mylinuxusername/public_html/test.php

I get "Object not Found"

If I use default dir putting test.php file in /srv/http and go to

http://localhost/test.php

it is ok.

Last edited by mshan (2014-11-04 04:49:43)


Amazing !

Offline

#2 2014-10-21 08:56:35

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] cann't set open_basedir in php.ini

Try changing the DocumentRoot and the <Directory> paths to /home/mylinuxusername/public_html, in the apache site configuration file.

Offline

#3 2014-10-21 15:34:53

aditya3098
Member
From: In front of the computer
Registered: 2014-05-01
Posts: 53
Website

Re: [SOLVED] cann't set open_basedir in php.ini

If you enabled userdir extension, as mentioned on the wiki, then you need to use:

http://localhost/~mylinuxusername/test.php

UPDATE {

Also:

chmod -R 755 ~/public_html

Could help.

ALSO: Try adding /home to your basedir

}

Last edited by aditya3098 (2014-10-21 15:38:59)

Offline

#4 2014-11-04 04:49:14

mshan
Member
Registered: 2013-05-05
Posts: 105

Re: [SOLVED] cann't set open_basedir in php.ini

it's shame.
I didn't do

$ chmod o+x ~
$ chmod o+x ~/public_html

now I did and get it ok.


Amazing !

Offline

Board footer

Powered by FluxBB