I am using 7.2.27 PHP version with Laravel 7.
Below code working on my local same configuration,
$captured = imagegrabscreen();
imagepng($captured, "~path/" . time() . ".png");
imagedestroy($captured);
But this code not working on live server it's throwing exception like,
Fatal error: Uncaught Error: Call to undefined function imagegrabscreen() in ~file-path:11 Stack trace: #0 {main} thrown in ~file-path on line 11
I don't know what is the exact issue.
I also checked below answer but I don't know what is php_gd2.dll,
https://stackoverflow.com/a/8715544/6656706
Edit:
I also tried on AWS ec2 with xampp but not working ! I also tried by installing php_gd2.dll.
Any help will be appreciated !
Thanks.
If the server is on Linux, it can't work because imagegrabscreen() is only supported on Windows:
Note:
This function is only available on Windows.
Also note that the screenshot is performed on the server. It will not capture the user screen.
Related
i am doing web application based on php ,
while i am forcing my content to network printer
the following error was happening..
Fatal error: Uncaught Error: Call to undefined function printer_open()
in E:\xampp\htdocs\print\index.php:3 Stack trace: #0 {main} thrown in
E:\xampp\htdocs\print\index.php on line 3
my codes :
$php_content='Test Print';
$handle = printer_open("\\\\192.168.2.4\\EPSON L365 Series");
printer_write($handle, $php_content);
printer_close($handle);
I am adding php_printer.dll file to xampp/php/ext folder
and adding the extension=php_printer into php.ini file
After restarting my xampp server its working fine on locally.
Same code I was executed on my Cpanel server HTTP ERROR 500 was showing.
Kindly give the solution for this..
Thanks in advance.
I am trying to shadow a live website to my local machine, I have finished all the copy thing for home folder and database from cpanel.
So far, I didn't make any change on code part, and just installed xampp and set up phpmyadmin.
after I set the localhost, and loaded the local page then below message displayed.
Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in F:\htdocs\ramtaps\includes\php_library.inc:41 Stack
trace: #0 F:\htdocs\ramtaps\includes\php_library.inc(19):
phpLibrary->createGlobalDatabaseConnection() #1
F:\htdocs\ramtaps\includes\php_library.inc(469):
phpLibrary->__construct() #2
F:\htdocs\ramtaps\includes\config\master.php(859):
include('F:\\htdocs\\ramta...') #3 F:\htdocs\ramtaps\index.php(4):
include('F:\\htdocs\\ramta...') #4 {main} thrown in
F:\htdocs\ramtaps\includes\php_library.inc on line 41
So I looked into the code and it said that mysql_connect is deprecated.
I am pretty new one this field and tried few things and they didn't work so far.
If anyone advises me regarding on this, I would really appreciate.
although you did not mention your PHP version, it is obvious that you are using PHP with version > 7
mysql_connect was removed in PHP 7.0.0 and above
http://php.net/manual/en/migration70.incompatible.php
either install older version of PHP, or change your code
and maybe this is usefull for you http://php.net/manual/en/mysqlinfo.api.choosing.php
I'm currently trying to connect to a MSSQL database, but from what i've read so far, there are actually extensions and files that i need to download from microsoft itself which i've went and download it here.
https://www.microsoft.com/en-us/download/details.aspx?id=20098
The error that i'm receiving currently receiving is the following.
Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\index.php on line 5
As far as i understand, i know that i'm supposed to append some extensions into the php.ini located in my xampp\php\php.ini file. However, even after appending the file from microsoft, i still can't seem to get connected.
I heard some people mentioned that the php version that i'm using which is currently PHP Version 7.1.1 has some issues connecting back to MSSQL databases but i'm not entirely sure.
Would someone be able to point me to right direction? i've tried looking up and down appending different files into the extension but i still can't seem to do it.
Thank you very much in advance.
edit:
PHP 7 on IIS: Call_user_function could not be located
i've also visited this link, however i'm unsure whether if this is related to the issue I have as i'm on 7.1
I am trying to run LWT on my mac and have installed MAMP for this. I have followed these instructions, but when I try to go to http://localhost:8888/lwt/ I am getting:
The localhost page isn’t working
localhost is currently unable to handle this request.
500
I have created a different folder in my htdocs folder and created a php file in it (index.php), with some code to see if php is working:
<?php
echo "this is the start";
phpinfo();
echo "<br>this is the end";
?>
That is all fine and works. I have also checked the user-rights for the lwt folder, but it seems fine too (Admins & Me are Read&Write, Others are ReadOnly). Typing tail -f /Applications/MAMP/logs/php_error.log into the terminal gives me the following error log:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /Applications/MAMP/htdocs/lwt/utilities.inc.php:3272
Stack trace:
#0 /Applications/MAMP/htdocs/lwt/index.php(46): require_once()
#1 {main}
thrown in /Applications/MAMP/htdocs/lwt/utilities.inc.php on line 3272
I am a beginner though, so I don't know what else the problem could be. Any ideas?
I don't know which version of PHP you use. But the mysql_* function are deprecated and its possible that its not included in your new version anymore. Use mysqli_* to connect to your database or use PDO.
In the new version of MAMP is PHP7 included. Perhaps you use that.
I'm developing a PHP application which generating reports to PDF
Right now I'm facing some troubles
I'm working from my own computer with XAMPP Server and the code ran well
But when I copied the codes to my office's WAMP5 Version 1.6.5 Server I got errors
Fatal error: Call to undefined function array_fill_keys() in D:\wwwroot\tcpdf\include\tcpdf_fonts.php on line 1848
I went to that troubled line and removed it, but another Fatal error: Call to undefined function occured
Is there something wrong with my WAMP5 configuration?
Thanks
Your version of php is to old... as Royal Bg suspected.
Either upgrade to 1.6.6 for php 5.2. But if there is no reason to use such an old version switch to something less than 7 years old :)
see:
http://sourceforge.net/p/wampserver/news/?source=navbar