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.
Related
I am getting error
Fatal error: Uncaught Error: Class 'MyClass' not found in /home/x/domain.com/x/x/init.php:3 Stack trace: #0 /home/x/domain.com/x/login.php(6): require_once() #1 {main} thrown in /home/x/domain.com/x/x/init.php on line 3
The thing is, I can run it in XAMPP on localhost without problems, I even ran it on the webserver before. The only thing I did is: deleted DB & files from webserver and 1:1 copied from XAMPP to the webserver and by that moment, I am getting this error.
I have edited things like DB connection etc, there is no error at all ** I THINK ** (since it is running fine in the XAMPP, PHP version is same on webserver as XAMPP (7.3)).
Webserver is running on Namecheap, it is shared hosting, so it is Litespeed server
mainfolder/index.php which is redirecting to login.php (mainfolder/clients/login.php) & login is calling init.php which is in clients/iip/init.php. require_once 'iip/init.php'; (i tried even './iip/init.php') and that 'user' class is located in iip/functions.php called from iip/init.php ( require_once 'functions.php'; )
EDIT: I tried to access init.php at the working XAMPP side and i am getting the same error, BUT site is still working, i am confused
Are you sure you specified your DocumentRoot (in apache config file) correctly?
It seems that your web server can't find specified file or MyClass is not defined in specified file.
You are probably making a mistake specifying the file path. The file path could be like "localhost/functions.php".
Also, after uploading the files to the server, are you sure that you can make the database connection without any problems?
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.
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 know there are tons of questions about this on SO. But I've been trying to fix this since a month with no luck.
At work we have this very old website that uses an access database, and I cannot do anything about it.I want to work on some changes on my local PC using wamp server. So I donwloaded the website along with the db. Here is how it's supposed to connect :
$conn = new COM('ADODB.Connection');
$db = realpath("dbalerts.mdb");
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");
But it's giving me this error:
Fatal error: Uncaught exception 'com_exception' with message 'Source: ADODB.Connection
Description:Provider cannot be found. It may not be properly installed.'
in C:\wamp\www\testaccess\index.php:5 Stack trace: #0 C:\wamp\www\testaccess\index.php(5): com->Open('Provider=Micros...') #1 {main} thrown in C:\wamp\www\testaccess\index.php on line 5
It's a test folder whith an index.php where only that code is written. In the same folder is dbalerts.mdb
I tried everything I know. I downloaded AccessDatabaseEngine.exe from MS website which is supposed to have the driver. And it installed properly with no errors( had to uninstall office because it was 64bit)
I am on a win8 machine
Any ideas how I can fix this all while still using COM and ADODB? Because I can't go through changing the connections of every .php file in that website (it's old and poorly designed so not adaptable to changes)