No php.ini file

No php.ini file

by Nick Mitchell -
Number of replies: 8

Went in search of my php.ini file so I can correct my "Enabling the PHP setting display_errors is not recommended on production sites because some error messages may reveal sensitive information about your server." notification, but alas, twas not to be found.  My PHP info says it's in web/conf but I can't find that either. I don't have a problem with editing or writing my own php.ini file, I'd just like to know where it is or where to put it.

Anybody have any suggestions on this?

 

Moodle 2.6+

Average of ratings: -
In reply to Nick Mitchell

Re: No php.ini file

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, what operating system is this and/or is it hosted?

When you go to Site admin > Server > PHP info, what *exactly* do the lines in the top section that refer to php.ini say? Take a screen shot if it's easier. 

 

It's highly unlikely you don't have a php.ini

Average of ratings: Useful (1)
In reply to Howard Miller

Re: No php.ini file

by Nick Mitchell -

Linux server.

Site admin exactly says web/conf

 

Attachment Screen Shot 2014-02-17 at 9.48.37 AM.png
In reply to Nick Mitchell

Re: No php.ini file

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I am not an expert about these things, but it appears to me that you indeed do have a php.ini file.  If you look at your figure, "Loaded Configuration File", I think it shows you the location.

Average of ratings: Useful (1)
In reply to Rick Jerz

Re: No php.ini file

by Nick Mitchell -

I see what it says, but can't find that path anywhere. I've run searches through my ftp client, I've looked in every directory.  I've looked/searched for directories called "web" and "conf", I've looked/searched for php.ini and php5.ini and come up with nothing.  Is it possible that they've been hidden?

In reply to Nick Mitchell

Re: No php.ini file

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Most likely a shared web-hosting, where you don't have direct access to the php.ini.

Your alternative is the .htaccess file. See https://httpd.apache.org/docs/2.2/howto/htaccess.html.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: No php.ini file

by Nick Mitchell -

That would explain it, ran into that once before with WordPress, forgot all about it.  In that particular case, though, I was able to inject my own php.ini file.  Would I be able to do the same here? If so, I assume it needs to go into the highest Moodle directory.  Am I wrong?

In reply to Visvanath Ratnaweera

Re: No php.ini file

by Nick Mitchell -

That would explain it, ran into that once before with WordPress, forgot all about it.  In that particular case, though, I was able to inject my own php.ini file.  Would I be able to do the same here? If so, I assume it needs to go into the highest Moodle directory.  Am I wrong?

In reply to Nick Mitchell

Re: No php.ini file

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

To be pedantic - it says /web/conf which is a very different thing to web/conf. 

Yes - you may be able to use .htaccess. As this sort of this varies, you are better to ask your hosting company's support how this works as it can vary quite a lot in the way it is set up. We would just be guessing. 

Average of ratings: Useful (2)