php_fileinfo is not enabling in php.ini file - php

I am using godaddy VPS having php version of 5.4.33.
Now I want to enable php_fileinfo extension in ini file to avoid the error
Fatal error: Class 'finfo' not found in my php script.
To enable I did the following:
1. open WebHost Manager.
2. Go to Service Configuration
3. Go to PHP Configuration Editor
4. search extension directive and fill as `fileinfo.so` in the input box and save
5. restart all services.
6. create a file in the server with the code <?php echo phpinfo();?>. but in that I am not finding any `fileinfo` status. It indicates still it is not enabled.
Could you please help me why this is not configured still?
Thanks in advance.

You could do that with EasyApache:
In the PHP version selection page, please choose version 5.3 or above, as FileInfo is available to version 5.3.X or above only.
Then, select Exhaustive Option List
If you don't know anything about EasyApache, you could read the documentation: https://documentation.cpanel.net/display/EA/EasyApache

Related

I'm trying to enable sqlsrv in PHP on my local machine, but it's not showing in php.ini

I'm trying to enable sqlsrv in php, i've installed/downloaded the php_sqlsrv_74_ts_x64.ddl and added it to the extensions in php.ini, resarted iis. When I open phpinfo it doesn't show.
I cannot figure out what's wrong with it.
I'm trying to connect to a MS SQL server.
PHP Version = 7.4.6.
Any help is appreciated.
You should be able to view the real error message when you double click C:\...\PHP\v7.4\PHP_CGI.exe like
So please check whether your extension_dir are pointing to the right place.
extension_dir = "C:\Program Files\PHP\v7.4\ext"
And you have put php_sqlsrv_74_ts_x64.dll in the ext file.
This is how I register the extension. The driver file must match the PHP version, architecture, and threadedness of your PHP environment.
extension=sqlsrv_74_nts_x64
You can modify the configurations untill php-cgi.exe no longer report any exception.
Finally the most important thing is run "IISRESET" in CMD adminsitrator mode.
Then you will see these extension in phpinfo.
Please ensure your IIS is mapping to the correct php_cgi.

Magento2 setup error stating i need to change php.ini setting but it is already set

I am trying to set up a Magento 2 app.
I keep getting an error like this:
Your PHP Version is 5.6.31, but always_populate_raw_post_data = 0.
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1.
If you need more help please call your hosting provider.
First of all I have 3 dirs: PHP5.6.31, PHP7.0.23, PHP7.1.9.
So in the PHP 5.6.31 i have 3 ini files all of witch have this setting.
always_populate_raw_post_data to -1
The other 2 folders PHP7.0.23, PHP7.1.9 don't have this in the php ini because it is newer version of php. My question is what can i do to resolve this issue if the php ini does have the correct settings but the install says otherwise?
Well Magento 2.1.11 does not support PHP 5.6.31, but only from 5.6.4 and upper.
Have a look here.
So, try first running
which php
to see which version it is trying to use, then either you can uninstall the 5.6 version and (better) use the php7 version, or be sure it is using the proper one.
Hope it helps.

How do I enable mbstring on our PHP 5.4.33 Apache Server?

I recently moved to an unmanaged VPS and added a Joomla component to a client website and received the following error when attempting to use a specific part of the component.
Fatal error: Call to undefined function mb_strtolower() in /home/oursite/public_html/components/com_rsfiles/helpers/files.php on line 135
I'm sure if this was on a shared machine the error would not have been thrown because they would have configured the server to accept it. But that is not my case. I have to configure it to work.
The original error lead me to identify if mbstring was enabled on our server and it was not.
So I wondered how I could enable it. Googled it! found it may be a derivative of the php.ini file so I tried to enable it using this php.ini definition. zend.multibyte = 1. After adding the line I restarted the Apache web server but the php info page still showed it disabled. :-(
After making the above modification I received a different error when attemoting to access the same page throwing the original error. This is the new error:
Fatal error: Could not convert the script from the detected encoding "UTF-8" to a compatible encoding in /home/psgadmincore/public_html/libraries/legacy/controller/legacy.php on line 609
There are 8 other mbstring items in the php.ini file but they are all commented out.
;mbstring.language = Japanese
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http.output = SJIS
;mbstring.encoding_translation = On
;mbstring.detect_order = auto
;mbstring.substitute_character = none
;mbstring.func_overload = 0
I un-commented all of these thinking they had to be enabled also, but the "Could not convert the script" error is returned.
Can someone please direct me to a procedure that outlines the steps necessary to include the "Multibyte String library"?
CENTOS 6.7 x86_64 virtuozzo w/Cpanel - php 5.4.33
These sites have not help me:
http://php.net/manual/en/ref.mbstring.php
http://php.net/manual/en/ini.core.php#ini.zend.multibyte
Thank you
After #ceejayoz response I though I would upgrade the php build to 5.6. I used EasyApache in the WHM to carry out the process below. During the upgrade I was able to select mbstring module in the Exhaustive Options List.
Log in to WHM as the 'root' user. In the Find box type easy. Click
EasyApache (Apache Update). Leave default, and then click the gear
icon (Customize Profile).
Leave default, and then click Next Step.
Click Exhaustive Options List. (this is where I selected the
mbstring module)
Click the name of the Apache or PHP module, and then click Save and build.

PHP log full of suhosin errors

Hello I have simple php script well it is more a html file with few php lines.
Yet it produces tons of errors in log that look like this on every line:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
I can not locate in nowhere in code where suhosin might been called...
This error is present on 2 different servers.
EDIT:
In phpinfo there is no suhosin present...
Thanks.
We will likely need more information in order to provide an accurate resolution, such as What version of PHP is installed on your system? however I will give you a general resolution.
Generally this issue is caused by PHP Upgrade, most recent PHP versions does not support suhosin as this only applied to older versions of php that needed additional security.
If you are on a shared hosting server you need to contact to your hosting provider and notify them about this issue, they are likely able to resolve it quickly.
If you are on a Dedicated server, VPS server or a localhost environment you can solve this issue by following the steps below:
Find your php.ini location [You can use phpinfo() to locate php.ini file]
Open the php.ini file and search suhosin.so
When you find suhosin comment this line extension = "suhosin.so" by adding semicolon at the beginning of the line, For example: ;extension = "suhosin.so"
Save this file
Restart Apache service httpd restart
Note: If ClouldLinux installed on your server, you need to force update CageFS by issuing the following command at the command line cagefsctl --force-update

wamp cannot load mysqli extension

WAMP installed fine, no problems, BUT...
When going to phpMyAdmin, I get the error from phpMyAdmin as follows:
Cannot load mysqli extension. Please check your PHP configuration
Also, phpMyAdmin documentation explains this error message as follows:
To connect to a MySQL server, PHP needs a set of MySQL functions
called "MySQL extension". This extension may be part of the PHP
distribution (compiled-in), otherwise it needs to be loaded
dynamically. Its name is probably mysql.so or php_mysql.dll.
phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
Finally, the apache_error.log file has the following PHP warnings (see the mySQL warning):
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
PHP Warning: Zend Platform does not support this version of PHP - please upgrade to the latest version of Zend Platform in Unknown on line 0
PHP Warning: Zend Debug Server does not support this version of PHP - please upgrade to the latest version of Zend Debug Server in Unknown on line 0
PHP Warning: gd wrapper does not support this version of PHP - please upgrade to the latest version of gd wrapper in Unknown on line 0
PHP Warning: java wrapper does not support this version of PHP - please upgrade to the latest version of java wrapper in Unknown on line 0
PHP Warning: mysql wrapper does not support this version of PHP - please upgrade to the latest version of mysql wrapper in Unknown on line 0
So, for some reason PHP is not recognizing the mysql extension.
Anyone know why? Any solution or workaround?
I deleted the PHP in program files ad everything started working , the problem that there two installations of pHp
I tried many solutions, and none worked for me. I tried the following solutions:
Restart wampserver
Reinstall wampserver
restart machine
and all other solutions mentioned in this question.
However, none of these worked. Then I found that my PHPMyAdmin was not working in chrome and was working in firefox. So I tried clearing cache, restarting browser etc, but still it would not work.
Then I deleted all the files from C:\wamp\tmp and then tried again, and it works. I am not sure why it works, but here is what I think. The session was cached and not getting cleared. So as soon as I deleted all files in this directory all the sessions were deleted and hence it worked fine.
First, make sure that the php.ini file is loading the mysqli extension.
If you are using WAMPServer, click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked. If not, go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.
If this still does not work, double check that the right php.ini file is being loaded.
To do so, view your phpinfo() (Here for WAMPServer). Scroll down to the Loaded Configuration File row and see which php.ini is being loaded.Make sure it is the right file. If you're using WAMPServer, it should be(WAMP INSTALL FOLDER)\bin\apache\Apache2.2.11\bin\php.ini. By default, it isC:\wamp\bin\apache\Apache2.2.11\bin\php.ini`.
If a different php.ini file is being loaded, just rename it to something else so that PHP will try and find the file somewhere else. There should be a way to specify which on eyou want to use, but I forget exactly how to do that...
If this still doesn't work... Try messing around with phpMyAdmin's settings, or using another answer, but I'm afraid I can't help beyond this.
I was running WAMP with two PHP versions 1) 5.2.9 and 2) 5.2.13.
As per site requirement i needed to change PHP version to 5.2.9 from 5.2.13. after swapping PHP version, error was "mysqli extension is missing". after debugging long time i get to know it was due to wrong "extension_dir" path in php.ini file.
So i changed its value:
Old: "extension_dir" c:/wamp/bin/php/php5.2.13/ext/
New: "extension_dir" c:/wamp/bin/php/php5.2.9/ext/
Restarted All services in wamp server, then it's fixed.
I had the same problem. I had WAMP server installed. All was working fine. Then one day I restarted my computer and it just stopped working! I tried desperately going through all help posts and doing them but nothing worked.
What they usually suggest you do is, first go to your php.ini file and make sure your 'extension_dir' is properly set. Then to make sure these two lines are not commented (remove the ; infront):
extension=php_mysql.dll
extension=php_mysqli.dll
Then some suggested that I download fresh copies of these two files but none worked. I also tried uninstalling everything (php/mysql/apache) and reinstalled fresh copies of WAMP server several times but with no luck.
Finally I managed to find an alternative solution. I switched to 'easyphp' (http://www.easyphp.org/). This is something very similar to WAMP. First I made backups of my sql databases so I can reload them on the new installation.
Then I installed 'easyphp' and everything seems to work fine. I reloaded my sql databases from my backup and now things are back to normal.
I hope someone suffering from a similar prob. will find this useful. If someone has really found a fix to make WAMP server work. Pls do be kind enough to post it here so many will benefit.
in wampserver go to php.ini. open the file and uncomment extension=msql.dll by removing semicolon(;) for respective operating sytem.
Just add in your php.ini:
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
Also setup the mysql password:
SET PASSWORD FOR root#localhost=PASSWORD('your_password');
And the phpmyadmin mysql password in config.inc.php:
$cfg['Servers'][$i]['password'] = 'your_password';
Had the same problem, with wamp. Try to exchange your current version of php.ini with a backup. There is one in: wamp\bin\php\php5.3.0phpForApache.txt. Worked for me.
Just wanted to chime in on this one. Using Wamp Server 2.0, and using Zend Studio with Zend debugger for development.
I wasn't able as of yet (will get back to it at some point) to get the zend debugger working with php 5.3. So in wamp I loaded an earlier php version, 5.2.11. I was getting the same error when acessing php my admin.
What I had to do was change the php.ini file value for "extension_dir" to c:/wamp/bin/php/php5.2.11/ext/ to match the version of php I was using. After that it was all good.
I had this problem and spent 2 hours trying all the solutions online, none worked.
Tried this, and it woked:
Change
mysql.default_host =
to
mysql.default_host = localhost
and restart WAMP. pay attention if you are using mysqli or not.
I had the same error. When I increased the script memory size and enabled E_ALL then restarted the server, I got that error in phpmyadmin. All I had to do to fix it was restart my computer!
I got this problem for a long time. Tried all I've read on forums and this finally worked for me:
Open your php.ini (I assume you've got the good one that is loaded...) and find this line
mysqli.default_port = 3306
change for
mysqli.default_port = 80
Restart all services
Go to localhost/phpmyadmin -> won't work
Reopen the php.ini file and retype this
mysqli.default_port = 3306
Restart all services
Worked for me.
For me worked this, after searching all logs/internet/every non-normal things.
You have to register dl by:
Through application:
WAMP -> PHP settings -> enable dl
or
# php.ini #
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
I have just installed WampServer, and faced same problem. I have found solution, that works for me, it is ridiculously simple.
Disable PHP extension php_mysqli.
Restart WampServer, visit local phpmyadmin.
Enable php_mysqli back.
Repeat step 2.
After few page refreshes, remaining errors plates (about MySQL and sqli) had gone.
i tried hard by
installing the wamp again and again,
by checking the php.ini file,
by restarting the machine,
by replacing the index.php file,
but none works.
then i go to the wamp/temp and deleted all files and it works fine now.
I had path variable in windows set to some random version of php.
The fix was to update it and set it to the folder within my wampserver installation:
C:\wamp64\bin\php\php5.6.38
Then I realized this is wrong also for my specific case, and I should actually be running the script from within vagrant. Live and learn.
I had this issue because of a different reason:
Check the PHP Error Log(Get from the Wamp Tray -> PHP -> PHP Error Log.
I had a syntax error in the php.ini file while I was editing the file.
Check the log and clear the error. This will open your PhpMyAdmin properly.
Check your phpForApache.ini file's extensions. This file should be same as your php.ini file.

Categories