Mobile app version of vmapp.org
Login or Join
Gonzalez347

: Turning openbase_dir off using .htaccess I'm trying to run a script on my shared hosting account, I keep getting an error relating to open_basedir, which I understand would normally be turned

@Gonzalez347

Posted in: #Htaccess #Php

I'm trying to run a script on my shared hosting account, I keep getting an error relating to open_basedir, which I understand would normally be turned off in the php.ini file, which I don't have access to.

Speaking with the host they recommended that I put this line php_flag open_basedir off in my .htaccess file, so it now looks like this:

<Files ~ "^.(htaccess|htpasswd)$">
deny from all
</Files>
AuthUserFile /var/www/vhosts/mydomain.co.uk/httpdocs/pri/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
order deny,allow

php_flag open_basedir off


But I still cant get the script to run, have I implemented it correctly? Is there a line in the phpinfo() output that I can view to tell if its worked?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

I could be wrong but as far as I've experienced this value you can not be set in the htaccess since its not supported, not every php.ini change can be done via the htaccess for security reasons.

open_basedir should be set in the httpd.conf, php.ini or vhost.conf

Most web hosting providers actually allow you to create your own php.ini in the home folder of your account, in fact I've yet to come across one that doesn't allow this. Basically yes you use a shared php.ini but you can create your own with certain values in your hosting folder, this is not something which they advertise and you need to ask.

Personally I'd get back on to your support at the hosting, after all isn't that what your paying for?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme