How to configure php.ini on the free hosting

How to configure php.ini on the free hosting

by max liao -
Number of replies: 11
I want to install moodle on the free hosting.
I would like to set "extension=php_curl.dll" in the "php.ini" ,
but I could not find this file.
Someone know where this file is.
Average of ratings: -
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,

The web host has access to the php.ini file that applies to all their clients, and you don't. You need to ask them if they have a procedure for creating a custom php.ini file. See

http://moodle.org/mod/forum/discuss.php?d=97251#p429865
http://moodle.org/mod/forum/discuss.php?d=97357#p430159

RLE
In reply to Richard Enison

Re: How to configure php.ini on the free hosting

by max liao -
Thanks a lot
I will ask them about it.
In reply to Richard Enison

Re: How to configure php.ini on the free hosting

by max liao -
Excuse me
I already ask them.
They say that I can access php.ini.
So I create .htaccess and just type follwing:

extension=php_curl.so
extension=php_openssl.so
extension=php_xmlrpc.so

I put it in "root/htdocs" and connect the moodle.
But it show following:
YOU ARE VIEWING THE OLD WEBSITE
PLEASE WAIT WHILE YOU ARE REDIRECTED SO I couldn't connect my moodle. When I delete .htaccess , could connect the moodle. Why does not it work?
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,
  1. Some (but not all) settings in php.ini can be made in .htaccess, but they must be made with php_value and php_flag directives (php_flag for boolean settings, php_value for others) because .htaccess is an Apache file, not PHP. See http://docs.moodle.org/en/Installing_Moodle#Using_a_.htaccess_file_for_webserver_and_PHP_settings
  2. Only php.ini settings that are classified as PHP_INI_PERDIR or PHP_INI_ALL can be made this way. But PHP extensions are not settings at all, and cannot be made in .htaccess.
  3. You said, "They say that I can access php.ini." Did you mean that you cannot access php.ini? Well, that's what I said, but the question was whether they supported the creation of custom php.ini files. At this point, I will assume that you did ask that and the answer was no.
  4. So unless you can get your host to install the PHP extensions that Moodle requires, you will need to find another host.
RLE
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,

5. Also, the message

YOU ARE VIEWING THE OLD WEBSITE


does not seem to be coming from Moodle. I suspect it is coming from your host, which makes me wonder what directory you were browsing to.

6. Did you read the link in MK's post in your previous thread? It specifically says curl is disabled on your free host, among other things.

RLE
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,

I was just reminded that there is a third alternative: you can use the PHP function dl to load extensions dynamically, at runtime. So you could put these lines

dl('php_curl.so');
dl('php_openssl.so');
dl('php_xmlrpc.so');

into the beginning of a php script file, assuming those are the correct names of the extension files on Linux systems, which I doubt. If you have already created your config.php file in the main Moodle directory, I would put them there; if not, at the top of install.php.

But none of that will do any good if
  1. those files are not in the extension directory on your host, or
  2. your host has disabled those features (like curl), which it has.
EDIT: In your opening post, you used the dll form of the extension file names, implying your site is on a Windows server. In your last post, your extension names ended .so, implying a Linux server. So at this point I don't know which it is. I just think the Linux forms are incorrect because I have the impression that the Linux names don't begin with php_. But I could be mistaken.

Based on the image link in your previous thread, it looks like it's Linux. Unless you've changed servers.

RLE
In reply to Richard Enison

Re: How to configure php.ini on the free hosting

by max liao -
Sorry
I mean that couldn't use custom php.ini, just use the .htaccess.
I sure that the Free hosting can support curl, openssl and xmlrpc.
So I want to know how open them through .htaccess.
In reply to max liao

Re: How to configure php.ini on the free hosting

by max liao -
I find that free hosting is Linux and maybe not set php extension through .htaccess.
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,

As I've been saying, I don't think you can set extensions through .htaccess, but you might be able to with the dl function in the php code. Your host's website specifically says that on their free hosting, curl, among other features, is disabled. I'm sure they can support curl, openssl, and xmlrpc; but then it wouldn't be free anymore.

RLE
In reply to max liao

Re: How to configure php.ini on the free hosting

by Richard Enison -
ML,

I take it back. I took another look at the page about free hosting restrictions (http://byet.net/showthread.php?t=2162) that MK found and reported in your previous thread, and it turns out that one of the things they disable is the dl function. So you can't use that either!

RLE
In reply to max liao

Re: How to configure php.ini on the free hosting

by koyali allora -
Hi this is koyali and i am very new to join this site before enter this i really do not know about this site after visit this i know more information about this.Useful free application is really available but how to know more details a bout that please tell me more information.
============
koyali

phr