Lua error - MediaWiki templates - php

After installing Scribunto (adding the extension to the folder and adding in LocalSettings the following code:)
require_once "$IP/extensions/Scribunto/Scribunto.php";
I have imported the Template:Infobox and Module:Infobox (along with the ones which come with those), and after testing a basic infobox I received the Script error -
Lua error: Internal error. Error reading from pipe.
Afterwards, I have done some research and I added the following line (in LocalSettings):
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/binaries/lua5_1_4_Win64_bin/';
Then, the Script error changes to:
Lua error: Internal error: The interpreter exited with status 1.
I use Windows 10. How can I fix this?

Related

GuzzleHttp\Exception\RequestException: cURL error 0 -- IIS -- Windows 10 -- PHP V 7+

Enabled app insights on php project, it is working on host machine. However, during running the same code on local box getting following error: [seems some IIS config issue or update not sure]
Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in ....\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 186
and
Warning: curl_setopt_array(): Unable to create temporary file. in ....\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 56
Trace:
trace while running an application from IIS
check the plugins and look through the debug.log file in wp-content and most likely it is a plugin that is causing this issue. I found that Mailjet causes this issue when unconfigured. Simply activate the plugins found in the error log and this will help solve it. The Microsoft version of cURL in PHP will throw the error and the Linux variant will not.

My dynamic site is not loading when the site is online but works well in localhost

I'm getting this error when my site is online
[host www.sitename.com] Backend fatal error: PHP Fatal error: require_once() [function.require]: Failed opening required 'admin/config/connection.php' (include_path='.:/opt/cpanel/ea-php53/root/usr/share/pear:/opt/cpanel/ea-php53/root/usr/share/php') in /home/mistrybu/public_html/index.php on line 373\n
The site works well in localhost but when its put online , the dynamic part is not showing.
I changed the php version from php7 to php5 in cpanel. Now the front end is working but the backend is not.
Can someone help me solve this error?
PHP version
Definitely do not go back to PHP5. Keep it to 7. If that means rewriting some of the existing code, so be it, it will make your site more secure and more future proof.
Error Message
Your require_once() method cannot find or access a particular file. This is most probably because:
File missing
The file (connection.php) doesn't exist in the given location (admin/config). Now keep in mind that as the location doesn't start with a /, it's going to be relative to where the require_once() method is being run from.
Since you're running require_once() from:
home/mistrybu/public_html/
it's going to look for the file here:
/home/mistrybu/public_html/admin/config/.
Does that location exist? Does the connection.php reside in the folder?
Folder mismatch
Try adding the following prefix to your path, and see if that makes a difference:
require_once $_SERVER['DOCUMENT_ROOT'].'/admin/config/connection.php';
File errors
Maybe the file exists, but for some reason, gives an error. Try running the following from your command line and see if you get any errors:
php -f admin/config/connection.php

PHP 7 include file error - file name is parsed incorrectly

Recently I met a weird error and hope someone can help.
We use LiteSpeed WebServer and Nginx on top, with PHP 7.5 and MySQL 5 (well, WordPress is the framework). It runs well for many days.
Suddenly it goes fatal at this line in different files
include ("class-xxx.php");
The error log says
[02-Oct-2018 13:04:36 UTC] PHP Fatal error: require(): Failed opening required 'dlass-xxx.php' (include_path='.:/opt/cpanel/ea-php72/root/usr/share/pear') in /xxx.php on line N
I double checked the code and see that the file name is declared "class-xxx.php", but somehow the server tries to include "dlass-xxx.php", thus it cannot find the file and trigger fatal error.
Solution? I re-upload the file, it works. But then it goes fatal in another file, at similar lines using include.
I notice that the first character in the file name, for example "c", is read incorrectly and shift 1 byte before (or after), so the file name is correct.
Such as
include "class-xxx.php" is parsed/read as "dclass-xxx.php"
include "page-xxx.php" is parsed"read as "opage-xxx.php"
...
this is very strange. Do anybody know the reason? Is it related to any caching/memory management of LiteSpeed or Nginx or PHP 7. ?
It happens on PHP 7. only because if I switch to PHP 5.6, the error does not happen.
Hope someone can help. Thanks a lot.

require_once raise HTTP ERROR 500

I'm working in a team on a e-shop website.
Recently, we've passed on Debian Jessie and from php5.4 to 5.6
Since then, we have multiple bug with require and require_once
Here's a file that raise an ERROR 500
<?php
require('/data/vhosts/mycompany.com/public_html/mp/../includes/functions/marketplace_tools.php');
//print_r(get_included_files());
require_once('/data/vhosts/mycompany.com/public_html/mp/../includes/functions/marketplace_tools.php');
echo 'pouet';
?>
The error.log say this :
PHP Fatal error: Cannot redeclare match_marketplace_products() in Cannot redeclare match_marketplace_products() on line 1
The filepath is good.
Marketplace_tools.php don't have require/include in
Marketplace_tools.php is just a bunch of function we use
If I run this file in command line, it works well
If I uncomment the print_r, it does not raise ERROR 500
This bug randomly appear and disapear
Cannot redeclare match_marketplace_products()
This error message tells you that there is a function name (match_marketplace_products) in the file you're including that already exists in the current PHP program.
You're using require_once(), but check that you haven't pulled in the same file elsewhere using require() (or include()).
Also check that the function name match_marketplace_products is only defined in this one file -- if it's defined in another file that is also included, then this will cause this error.

Error during composer update/install upon migrating to remote server

The error in question:
[RuntimeException]
Error Output: PHP Warning: require(/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php): failed to open stream: N
o such file or directory in /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload_real.php on line 58
PHP Stack trace:
PHP 1. {main}() /home/admin/web/"webpage"/public_html/test/artisan:0
PHP 2. require() /home/admin/web/"webpage"/public_html/test/artisan:16
PHP 3. require() /home/admin/web/"webpage"/public_html/test/bootstrap/autoload.php:17
PHP 4. ComposerAutoloaderInit95cd02d44d232a8b8d6e5e52544d8647::getLoader() /home/admin/web/"webpage"/public_html/test/vendor
/autoload.php:7
PHP 5. composerRequire95cd02d44d232a8b8d6e5e52544d8647() /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload
_real.php:49
PHP Fatal error: require(): Failed opening required '/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php' (includ
e_path='/home/admin/web/"webpage"/public_html/test/vendor/phpunit/php-text-template:/home/admin/web/"webpage"/pub
lic_html/test/vendor/phpunit/php-timer:.:/usr/share/pear:/usr/share/php') in /home/admin/web/"webpage"/public_html/test/vendor
/composer/autoload_real.php on line 58
PHP Stack trace:
PHP 1. {main}() /home/admin/web/"webpage"/public_html/test/artisan:0
PHP 2. require() /home/admin/web/"webpage"/public_html/test/artisan:16
PHP 3. require() /home/admin/web/"webpage"/public_html/test/bootstrap/autoload.php:17
PHP 4. ComposerAutoloaderInit95cd02d44d232a8b8d6e5e52544d8647::getLoader() /home/admin/web/"webpage"/public_html/test/vendor
/autoload.php:7
PHP 5. composerRequire95cd02d44d232a8b8d6e5e52544d8647() /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload
_real.php:49
Background: Was developing locally, got to the point where I wanted to have a staging site. Set up the staging site on digital ocean (entOS 6.5 x64). I then cloned my git repo into my desired folder - configured vhosts DefaultDirectory to my public path.
A default installation works, composer update/install works. However, with my cloned repository I am getting said error. '/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php' is a file I made with some helper methods I could use in various controllers. It has not caused any problems locally. I can composer update/install locally, without any problems.
Any guidance would be greatly appreciated!
Are those literal quotation marks in your file path
/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php
Or are you just using that to indicate your website name normally goes there? If the former, I'd consider not doing that as it's pretty weird to have quotes in unix file names, and you may run into problems based on assumptions other people have made.
Regardless -- you have the information you need
[RuntimeException] Error Output: PHP Warning: require(/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php): failed to open stream: N o such file or directory in /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload_real.php
PHP is telling you it tried to require in a specific file
/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php
but it could not find it ("failed to open stream"). This means either the file doesn't exist on the computer you're trying to load it from, or PHP can't see it for some reason (try dumping the results of is_readable('/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php'); to see if PHP thinks it can read the file or not.

Categories