How to Open php.ini file from cPanel or WHM - php

Recently I have purchased a VPS and I have the root access. I need to enable the extension=php_mysqli.dll in php.ini. But I could not find the php.ini file. Actually I am a Windows User and I do not know how to use Linux or SSH Commands. I want to find php.ini file and open it manually and make my desired changes. Can Any one help me?

Edit, on a cPanel server you should not be editing the PHP.ini file to enable extensions like that.
Within WHM, locate EasyApache and go through the guided setup for Apache and PHP. In the 'Exhaustive Options' screen, you'll find a checkbox to enable the mysqli extension.
Enable all the extensions you need, then hit 'Save and Build'. This will rebuild Apache and PHP using the configuration you just selected.

Related

Windows Apache 2.4 - PHP cuRL not loading even though extension is set in php.ini

I am trying to activate curl on my Apache Server. So far it does not load.
I edited the php.ini file to allow the extension:
And I made sure using phpinfo() that I was editing the proper configuration file.
I restarted the server twice and made sure in php.ini that the extension folder (C:\php7\ext) was loaded correctly but curl still does not show on my phpinfo() page.
Why is this?

Editing php.ini with MAMP 3.5 where is the right ini file?

I'm trying to edit my php.ini file to turn off short tags. Pretty standard.
phpinfo() tells me I am running PHP Version 5.6.10
I have edited 2 php.ini files so far, and neither has taken effect (yes, I restarted MAMP)
MAMP/conf/php5.6.10/php.ini
MAMP/bin/php/php5.6.10/conf/php.ini
Neither file changes the status of short tags
Can anyone direct me where/how to change my php.ini settings?
I really freaking miss WAMP. Whose bright idea was it to buy a Mac?!?
When you run phpinfo() you need to look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.
Aaannnnnnnnddddd I was being a dufus
I had been commenting the line out instead of changing to "Off"
as you version is 5.6.10, and supposed your apache2 server runing on ubuntu.
php.ini dir is
/etc/php5/apache2/php.ini
On my Mac, running MAMP I have a few locations that would contain the likely php.ini
So I edited the memory_limit to different values in the 2 suspected files,
to test which one effected the actual MAMP PHP INFO page details.
By doing that I was able to determine that this was the correct php.ini:
/Applications/MAMP/bin/php/php7.2.10/conf/php.ini

CURL extension needs to be loaded - Opencart on WAMP 3.0.0

I have been trying to install opencart 2.1.0.2 on WAMP 3.0.0 but I keep getting the error message "Warning: CURL extension needs to be loaded for OpenCart to work! ", When I navigate to C:\wamp64\bin\php I notice there are two php folders here php5.6.16 and php7.0.0, although on my localhost page it says that the current php setting is php5.6.16. I did a CURL search inside my php.ini file (in the php5.6.16 folder) and I found the following string of codes
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
extension=php_bz2.dll
extension=php_curl.dll
I need some help here, how do I turn on / load CURL?
Sometimes there are several php.ini files. You need to find the one that is loaded at run time.
Create a new PHP file and echo your loaded PHP configuration: echo phpinfo();
Search if you can find a section dedicated for CURL.
If not, find the section Loaded Configuration Fileto see which php.ini file is being loaded.
Add extension=php_curl.dllto the loaded php.ini file.
Restart Apache.
Using the WAMPServer menus is the easiest way and ensured that you amend the correct php.ini file as there are 2 versions, one for Apache/PHP and one for PHP CLI. It will also make sure you amend the correct php.ini file for the version of PHP that is actually active when you make the amendment, remember WAMPServer can have multiple versions of Apache & PHP and MYSQL sitting on the system, but only one of each active.
(left click) wampmanager -> PHP -> PHP Extensions -> php_curl
Also if you are using a https address in your curl you will likely need to also include php_openssl
(left click) wampmanager -> PHP -> PHP Extensions -> php_openssl
If these items have a TICK beside them then they are already activated, if no tick then click the menu item, the php.ini file will automatically be amended and Apache restarted. You will see the wampmanager icon go Orange and then Green again when the amendment is complete and Apache restarted.

php.ini unable to change upload_max_filesize

I am developing php applications on Ubuntu 13.04 and when i am trying to change the upload_max_filesize setting:
$ sudo gedit /etc/php5/apache2/php.ini
and restart apache the values do not change in my phpinfo() they stay at the default values
This is the path mentioned in the phpinfo:
Loaded Configuration File /etc/php5/apache2/php.ini
Those values can be read from more than one location. You only show one location (and yes there is a phpinfo showing only one location but there are other elements in phpinfo hinting additional ini locations and to tell you the truth: the phpinfo does not show all inis).
So actually this depends on your configuration (which can greatly differ as you've got an open system) and the only thing we can say for sure is that you
a) edited the wrong file -or -
b) made a mistake while editing the right file.
To fix your issue, edit the right file.
To find the right file, learn about your systems PHP configuration.
To learn about your systems PHP configuration, start removing the ini and see what happens.
To learn about how it works in general - not specific to your system - you can easily consult the PHP manual:
Runtime Configuration Docs
Try to check if there is any syntax error in your php.ini, if there is any, it will not take the changes.
also make sure that your php.ini is writable
Or if you are on Linux (same will apply for windows, just different path), check the error log file with the command like this:
$ tail -n 100 /var/log/apache2/error.log
after restarting apache server
This will show you the line of the error and its cause in case of the syntax error in php.ini.
Check also "Scan this dir for additional .ini files" and "Additional .ini files parsed"

I have configured curl but it does not work

I am using windows server and have ran the following code to find my php.ini.
<?php
infophp();
?>
Then uncommented the extension=php_curl.dll and set the extension path on my php.ini.
At last downloaded and installed curl and restarted my server but there is still no information about the curl in my info.php
I have php_curl.dll in my ext folder (extension folder), libeay32.dll and ssleay32.dll are also in root of my php folder.
I had this problem a few times and most of them web server was picking up wrong php.ini.
Make sure the one you are editing is being used. Try disabling php in it totally and running your script to find out. Just change
engine = On
to
engine = Off
and try it out. If you still see php info page, that means web server uses wrong php.ini.
If you use Apache, you can specify in httpd.conf which php.ini to use with
PHPIniDir "C:/path/to/your/php/dir"

Categories