小编iqb*_*lmp的帖子

“ npm run dev”和“ npm start”之间的区别

我是Node和AngularJS的新手。我能知道节点终端中“ npm run dev”和“ npm start”命令之间的区别吗?

node.js npm angularjs

5
推荐指数
2
解决办法
5611
查看次数

.htacces-SetEnvIf转NGinx-fastcgi_param转换

我的Apache网站下面有.htaccess设置; 现在我把它移到Nginx.因此,我想知道如何将.htaccess文件中的'SetEnvIf'参数放在Nginx configuraiton下?我认为通过设置'fastcgi_param',请帮我进行转换.

SetEnvIf HOST albany\.mywebsite\.com MAGE_RUN_CODE=w2760
SetEnvIf HOST albany\.mywebsite\.com MAGE_RUN_TYPE=website
SetEnvIf HOST alexandria\.mywebsite\.com MAGE_RUN_CODE=w1472
SetEnvIf HOST alexandria\.mywebsite\.com MAGE_RUN_TYPE=website
SetEnvIf HOST annarbor\.mywebsite\.com MAGE_RUN_CODE=w2933
SetEnvIf HOST annarbor\.mywebsite\.com MAGE_RUN_TYPE=website
Run Code Online (Sandbox Code Playgroud)

谢谢.

apache .htaccess webserver fastcgi nginx

4
推荐指数
1
解决办法
3153
查看次数

Magento REST API错误500

我试图通过Magento REST API获取产品信息; 但结果出错"[message:protected] =>无效的身份验证/错误请求(得到500,预期的HTTP/1.1 20X或重定向)...... ................. ......"不知道为什么会这样; 有人可以帮帮我吗?我的代码如下:

$callbackUrl = "http://myhostcom/current_script.php";
$temporaryCredentialsRequestUrl = "http://myhostcom/oauth/initiate?oauth_callback=" .               urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://myhostcom/oauth/authorize';
$accessTokenRequestUrl = 'http://myhostcom/oauth/token';
$apiUrl = 'http://myhostcom/api/rest';
$consumerKey = 'xxxxxx';
$consumerSecret = 'xxxxxxxxxxx';
echo '<pre/>';
session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
    $_SESSION['state'] = 0;
}
try {
    $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
    $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
    $oauthClient->enableDebug();
    $oauthClient->disableSSLChecks();


if (!isset($_GET['oauth_token']) && !$_SESSION['state']) { 
    $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
    $_SESSION['secret'] = $requestToken['oauth_token_secret'];
    $_SESSION['state'] …
Run Code Online (Sandbox Code Playgroud)

rest magento

4
推荐指数
1
解决办法
3067
查看次数

PHP:更改权限和所有权后文件不可写

在 PHP 脚本中,检查文件是否可写时出现以下错误。

fopen(test.txt): failed to open stream: Permission denied
Run Code Online (Sandbox Code Playgroud)

请看打击详情:

  1. Apache 服务以用户:apache 身份运行,检查如下:

    ps aux | egrep '(apache|httpd)'

2.将要写入的文件和php脚本的所有权更改为apache。

chown apache:apache test.txt 
chown apache:apache test.php
Run Code Online (Sandbox Code Playgroud)

3.文件权限改为:777

chmod 777 test.txt 
chmod 777 test.php
Run Code Online (Sandbox Code Playgroud)

4.尝试过的设置:已经尝试过以下提供的解决方案:fopen Permission returned on a file with 777permissions

操作系统:红帽企业版

代码:

<?php
echo getmyuid().':'.getmygid(); 
echo "<br/>";
echo exec('whoami');
echo "<br/>";
$dst = 'test.txt';
echo $dst, file_exists($dst) ? ' exists' : ' does not exist<br/>', "<br/>\n";
echo $dst, is_readable($dst) ? ' is readable' : ' is NOT readable', …
Run Code Online (Sandbox Code Playgroud)

php apache httpd.conf

2
推荐指数
1
解决办法
4460
查看次数

标签 统计

apache ×2

.htaccess ×1

angularjs ×1

fastcgi ×1

httpd.conf ×1

magento ×1

nginx ×1

node.js ×1

npm ×1

php ×1

rest ×1

webserver ×1