Built-in function goes undefined - php

I have a laravel project up and running in my localhost. but when i upload all files to the server. it gives me error: The built-in function in laravel goes undefined.
FatalErrorException in Encrypter.php line 71: Call to undefined
function Illuminate\Encryption\openssl_encrypt()
How can i solve this?

You should edit php.ini file and uncomment an extension. For example, change this:
;extension=php_openssl.dll
to this:
extension=php_openssl.dll

just edit php.ini and uncomment this like
;extension=php_openssl.dll
chnaged to
extension=php_openssl.dll

Related

PHP Fatal error: Call to undefined function mysql_connect() in IIS

The same code works in Xampp. But if try to run it on IIS below error occurs.
"PHP Fatal error: Call to undefined function mysql_connect()"
I'm stuck with this error from couple of days.
I tried changing my php.in . My phpinfo.php points to correct .ini file
Please suggest me a way.
part of my php.ini file:
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mysql_libmysql.dll

Fatal error: Call to undefined function mysql_connect() and The mysqli extension is missing

I have below two in my php.ini file
extension=php_mysql.dll
extension=php_mysqli.dll
from the php.info(), can see below is correct.
Loaded Configuration File C:\Program Files (x86)\PHP\v5.3\php.ini
I have only one version php installed.
What else should I try?
The strange thing is, if I load my application the error is
Fatal error: Call to undefined function mysql_connect()
but if I load phpMyAdmin, after login the error is
The mysqli extension is missing. Please check your PHP configuration.
<img class="icon" src="./themes/pmahomme/img/b_help.png" width="11" height="11" alt="Documentation" title="Documentation" />
Make sure the path to php.ini is set and is visible in
at loaded configuration file.
if you are using windows.. make sure the use of / and \
in apache httpd.conf
it should be
PHPIniDir "C:/php/5.5/"

Call to undefined function curl_init() in wampp

I am getting an error. I have done the following:
Find file php.ini and uncomment in wamp apache folder
Find file php.ini and uncomment in wamp php folder
checked in wamp extensions
download file and replace php_curl-5.3.13-nts-VC9-x64.zip
restart wamp.
But I still get error
Fatal error: Call to undefined function curl_init() in C:\wamp\www\wordpress\wp-content\plugins\test\curl_http_client.php on line 66
Call to undefined function curl_init
You either edit wrong php.ini file or something is missing on your system, preventing curl extension from loading. You shall check with phpinfo() where is proper php.ini, then check if you got extension entry for cURL really enabled. If so and it is still not working then next step should be checking Apache's error.log looking for detailed error messages from PHP.

Fatal error: Call to undefined function mb_detect_encoding() in C:\Users\Jarek\mywebsite\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177

I am trying to set up phpMyAdmin, and i was following this site , but i got an error about "Fatal error: Call to undefined function mb_detect_encoding() in C:\Users\Jarek\mywebsite\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177", and i searched this error online, Most of suggestion are uncommon some lines in php.ini, but it didn't work for me.
This is the site tell you how to solve problem with this error.
solve 1
solve 2
php.ini is in my php folder which is located in c diver.
prompt command to check path
Every time i changed config, i also did restart apache.
I also tried to write some piece of code of php as below:
$con=mysqli_connect("127.0.0.1","root","xxxxxxx","morris_db");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
and open my browser, and type localhost/index.php, it shows me an error about "Fatal error: Call to undefined function mysqli_connect() in C:\Users\Jarek\mywebsite\index.php on line 8"
Try adding these extensions in the PHP.ini
extension=php_mbstring.dll
extension=php_gettext.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
Also check whether the PHP folder exists in the PATH.

Fatal error: Call to undefined function printer_open()

I'm trying to print some string using PHP, i'm using the PHP print functions:
$printer = ("HP LaserJet Professional P1102");
$handler= printer_open($printer);
$content="Test Content";
printer_write($handler, $content);
printer_close($handler);
but I got that error :
Fatal error: Call to undefined function printer_open() in C:\xampp\htdocs\print.php on line 12
after googling it i found that i must add the php_printer.dll to the extensions file in php and add it's extension to the php.ini file, then restarting the server services, all of that accomplished but still getting that error.
p.s. I've tried it on WAMP and XAMPP
I think solution would be extension location.php_printer extension should be stored in c:\xampp\php\ext and not in c:\xampp\php. So move it to the ext-folder, and restart Apache.
Can you look into the error_log, which tells you, if it fails to load the module. You should also run a phpinfo(), which shows up all loaded modules, you must find the printer extensions there.
I hope it may resolve your issue.

Categories