我想从localhost上的另一台服务器运行php脚本我试过include "http://example.com/settings/aiacacc.php";
但是我收到了错误。
include(): http:// wrapper is disabled in the server configuration by allow_url_include=0
如何使用include
文件从其他服务器启用php.ini
。我知道这不是一个好习惯,但我的应用程序只能在localhost上运行。我不希望禁用此设置。
我想从另一台服务器返回一个php脚本,然后在我的localhost上执行这个脚本
答案 0 :(得分:3)
转到您的#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
struct StackNode
{
int data;
StackNode* next;
};
StackNode* newNode(int data)
{
StackNode* stackNode = new StackNode[sizeof(StackNode)];
stackNode->data = data;
stackNode->next = NULL;
return stackNode;
}
int isEmpty( StackNode *root)
{
return !root;
}
void push( StackNode** root, int data)
{
StackNode* stackNode = newNode(data);
stackNode->next = *root;
*root = stackNode;
}
int pop( StackNode** root)
{
if (isEmpty(*root))
return INT_MIN;
StackNode* temp = *root;
*root = (*root)->next;
int popped = temp->data;
free(temp);
return popped;
}
int peek(StackNode* root)
{
if (isEmpty(root))
return INT_MIN;
return root->data;
}
bool AreEqual(StackNode** lhs, StackNode** rhs)
{
////// ?
}
int main()
{
StackNode* root = NULL;
StackNode * r2 = NULL;
push(&root, 10);
push(&root, 20);
push(&root, 30);
push(&r2, 123);
push(&r2, 1231213);
AreEqual(&root, &r2);
}
文件并对其进行编辑,以启用allow_url_include设置:
php.ini
或者在php文件中使用以下代码
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = On
答案 1 :(得分:2)
在php.ini中:
allow_url_include=1
答案 2 :(得分:0)
如上所述。你想从另一台服务器返回一些PHP代码并在localhost上执行它。为此,第一步是编辑php.ini
文件并添加此行allow_url_include = On
,其次,您要从其他服务器返回的php脚本不应该有.php
扩展名,而应该是保存为.txt
扩展名为