/    Sign up×
Community /Pin to ProfileBookmark

Can’t find php.ini

My phpinfo() says [B]Loaded Configuration File[/B] is at /etc/php.ini but no file exists at that location on the server.

I have two other php.ini files though, in /etc/php5/apache2 and /etc/php5/cli.

I need to edit the php.ini but which one, and why does phpinfo() say it’s somewhere it isn’t?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 07.2011 — Probably the one in the Apache directory for normal web pages (cli would be for command line interface).

Perhaps there is a symbolic link in /etc that you're not seeing?
Copy linkTweet thisAlerts:
@MigauthorFeb 08.2011 — What's a symbolic link and how do I view them?
Copy linkTweet thisAlerts:
@NogDogFeb 08.2011 — In UNIX/Linux, a symbolic link is essentially like a shortcut in Windows: it looks/acts like a file or directory, but is actually just a pointer to the actual file/directory it links to. If you're at a command line, [b]ls -al[/b] (lower case "L" in both places) should show all directories, files, and symlinks in a detailed listing, where symlinks in the listing should include the path-name to which they are linked.
Copy linkTweet thisAlerts:
@DasherFeb 08.2011 — Many webhosting companies use a common php.ini file. You can override this by specifying a custom one via cPanel. When you do that a fresh copy of php.ini will be loaded into your root directory. You can then modify this copy to your specific needs.
Copy linkTweet thisAlerts:
@DariaFeb 09.2011 — Another thing to consider, in regards to webhosting companies - some of them "block" your access to the php.ini, specifically when you are in the shared environment. If you do not have access direct access to it you may need to contact your host and have their techs modify the file for what you are trying to do, if it is "allowed" by their shared use policy. If not, some of the things that you are looking to do you may achieve via .htaccess file, instead. Just google php.ini and .htaccess together.
×

Success!

Help @Mig spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...