Call to undefined function http_get() - wampserver

I have installed WAMPServer and tried the PHP function; http_get(). I then get the following error message:
Call to undefined function http_get()
I have done the following:
Copied php_http.dll in wamp64\bin\php\php5.6.25\ext folder.
Added this line: extension=php_http.dll to my php.ini file.

Related

Error when running near indexer localnet, fail to generate config.json

So I'm trying to run the indexer on localnet following the official tutorial https://docs.near.org/docs/tutorials/near-indexer
However when I run cargo run -- init to generate the localnet json config I get this error
Finished dev [unoptimized + debuginfo] target(s) in 17.62s
Running `target/debug/example-indexer init`
thread 'main' panicked at 'Failed to deserialize config: Error("expected value", line: 1, column: 1)', /home/francois/.cargo/git/checkouts/nearcore-5bf7818cf2261fd0/a44be20/nearcore/src/config.rs:499:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
At some point it seems the json is not created or not created properly I guess, the function crashing in config.rf line 499 is
impl From<&str> for Config {
fn from(content: &str) -> Self {
serde_json::from_str(content).expect("Failed to deserialize config")
}
}
It's quite difficult to debug since cargo run -- init is using some inner near function (also I'm new to rust).
the config.json file is created but it seems the permission are not set properly by the script, the content of config.json is
"<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message> ... "
If anyone from the community has encountered this problem or has a hint it would be great!! thanks a lot !
In the tutorial you referenced, it mentions a similar error, and suggests the following:
Open your config.json located in the .near folder in the root of your home directory. ( ~/.near/config.json )
In this file, locate: "tracked_shards": [] and change the value to [0].
Save the file and try running your indexer again.
So I had the wrong config with download_config: false,
It should be download_config: false, for the localnet use

Why lua require won't search current directory?

say I've two files test.lua and m.lua in a folder, in test.lua as:
require("m")
then I run this file, howerver it raise an error:
lua: /Users/xx/works/scripts/test.lua:43: module 'm' not found:
no field package.preload['m']
no file '/usr/local/share/lua/5.3/m.lua'
no file '/usr/local/share/lua/5.3/m/init.lua'
no file '/usr/local/lib/lua/5.3/m.lua'
no file '/usr/local/lib/lua/5.3/m/init.lua'
no file './m.lua'
no file './m/init.lua'
no file '/usr/local/lib/lua/5.3/m.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './m.so'
As you can see the line no file './m.lua' appears but this is not true. ./m.lua exists, and file permission stuff is OK. If I hardcode the path:
package.path = package.path..';'..'/Users/xx/works/scripts/?.lua'
require('m')
It will work as expected.
What should I do to make lua search current directory fisrt (like python's import) when require a module
The current directory is the directory where you launch lua from.
The command line is missing in your example, if you used lua test.lua then it shoud work, if you used lua works/scripts/test.lua then it will not work.

How To Require Lua Socket?

I'm very new to lua development with file manipulation, and now trying to import the lua socket package into my project according to this post, but I can't run even the code below.
I guess the error message indicates I need to import not only the socket.lua but also .\socket\core (probably .dll, since it doesn't have core.lua), while a reply at the post suggested importing only the file.
I'm stuck in just the beginning... What do I have to do for the next step?
local function main()
local socket = require("socket")
end
main()
Exception in thread "main" com.naef.jnlua.LuaRuntimeException: ...n32.win32.x86_64\workspace\TestForCiv\src\socket.lua:13: module 'socket.core' not found:
no field package.preload['socket.core']
no file '.\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_151\bin\lua\socket\core.lua'
no file 'C:\Program Files\Java\jre1.8.0_151\bin\lua\socket\core\init.lua'
...(a bunch of no file errors continues)
Edit: I added the folder structure. Even I add the .dll file it returns the same error.
I don't know the details of you configuration, but try this
require ("src.socket")
you should require a module from the root path of the lib

Unable to load win32/api.so from ruby script

The command run the following :
C:\V4\framework\scripts > ruby SCM.rb
The error I get is the following :
C:/Rubby/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require: 126: The specified module could not be found. - C:/Rubby/lib/ruby/gems/2.4.0/gems/win32-api-1.4.8-x86-mingw32/lib/win32/ruby19/win32/api.so (LoadError)
from C:/Rubby/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Rubby/lib/ruby/gems/2.4.0/gems/win32-api-1.4.8-x86-mingw32/lib/win32/api.rb:2:in
The first few lines of the calling script looks like following :
require 'watir/win32ole'
require 'windows/com'
require 'windows/window/message'
The second line is giving the Load Error. I googled and am not able to find a solution.
I have faced the same issue , I got resolved this by download the zip file of api.dll from https://www.dll-files.com/api.dll.html and extract the zip file and then paste the 'api.dll' inside my ruby bin folder : "C:\Ruby22\bin

Yeoman - How to extract zipped files in generator?

I want to build a Yeoman generator that needs to unzip a file.
From their documentation, it seems this process is done using this.registerTransformStream(...). It says it accept any gulp plugin, so I tried gulp-unzip (link)
Here's my code:
// index.js
...
writing: function() {
var source = this.templatePath('zip'); // the folder where the zipped file is
var destination = this.destinationRoot();
this.fs.copy(source, destination);
this.registerTransformStream(unzip() );
}
...
The result seems promising, first it shows all the file list then I get Error: write after end error.
Here's the dump:
create license.txt
create readme.html
create config.php
...
...
events.js:141
throw er; // Unhandled 'error' event
^
Error: write after end
at writeAfterEnd (C:\Users\myname\Documents\project\generator-test\node_modules\gulp-unzip\node_modules\readable-stream\lib\_stream_writable.js:144:12)
at Transform.Writable.write (C:\Users\myname\Documents\project\generator-test\node_modules\gulp-unzip\node_modules\readable-stream\lib\_stream_writable.js:192:5)
at DestroyableTransform.ondata (C:\Users\myname\Documents\project\generator-test\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:531:20)
at emitOne (events.js:77:13)
at DestroyableTransform.emit (events.js:169:7)
at readableAddChunk (C:\Users\myname\Documents\project\generator-test\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:198:18)
at DestroyableTransform.Readable.push (C:\Users\myname\Documents\project\generator-test\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:157:10)
at DestroyableTransform.Transform.push (C:\Users\myname\Documents\project\generator-test\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:123:32)
at DestroyableTransform._transform (C:\Users\myname\Documents\project\generator-test\node_modules\mem-fs-editor\lib\actions\commit.js:34:12)
at DestroyableTransform.Transform._read (C:\Users\myname\Documents\project\generator-test\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:159:10)
The destination folder is empty after this. It seems the stream is trying to write the unzipped file but failed.
Does anyone solved this problem before? Or is there alternative way by just using the built-in fs?
Thanks a lot

Resources