我想查看所有分支的所有提交。所以我尝试了git log,但它给出了一些结果,并如下图所示:
spylh9999ggr's questions
当我尝试在 Ubuntu 14.04 上安装 apache2 时,我收到以下错误消息:
root@Final-Gitsetup-Developers:~# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libapache2-mpm-itk libapache2-mpm-itk:i386
E: Package 'apache2' has no installation candidate
结果apt-cache policy | grep http | awk '{print $2 $3}' | sort -u
http://archive.ubuntu.com/ubuntu/trusty/universe
http://repo.mysql.com/apt/ubuntu/wily/mysql-5.6
http://repo.mysql.com/apt/ubuntu/wily/mysql-apt-config
http://repo.mysql.com/apt/ubuntu/wily/mysql-tools
我们的服务器 [ ubuntu 14.04 ] 不工作,所以当我尝试:sudo service apache2 restart时,我得到:
然后当我尝试grep -ri listen /etc/apache2时,我得到了
如前所述,我尝试了netstat -ltnp | grep:80,我得到:
编辑
/etc/apache2/ports.cnf:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我没有得到下一步我需要做什么?
我收到这样的日志错误:
为了解决这个问题,我运行了以下命令并重新启动了服务器。
sudo apt-get install php-curl
sudo /etc/init.d/apache2 restart
sudo service apache2 restart
然后我检查了代码:<?php phpinfo(); ?>
,我得到了这个结果:
我还通过在 Web 浏览器中运行此代码进行了检查:
echo 'Curl: ', function_exists('curl_init') ? 'Enabled' : 'Disabled';
在网络浏览器中,它给出的结果是Disabled
.
另外,当我按照检查中的说明进行检查以查看是否在本地安装了 cURL 时?,我得到了这个结果:
在完成所有这些之后,我仍然收到那些日志错误。卷曲加载了吗?
我们正在尝试为 Magento 站点设置 cron 作业。
我们尝试了这个工作,但它对我们不起作用:
*/5 * * * * php -f /var/www/html/sitename/cron.php
为了调试我们尝试了这个工作:
*/5 * * * * /usr/bin/php -q /var/www/html/sitename/cron.php >
/var/www/html/sitename/cron-temp.log 2>&1
结果,我们在以下位置发现了这些错误cron-temp.log
:
PHP Warning: require(app/bootstrap.php): failed to open stream:
No such file or directory in /var/www/html/sitename/cron.php on line 30
PHP Fatal error: require(): Failed opening required 'app/bootstrap.php'
(include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/sitename
/cron.php on line 30
cron.php
<?php
// Change current directory to the directory of current script
chdir(dirname(__FILE__));
require 'app/bootstrap.php';
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
umask(0);
$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
$isShellDisabled = true;
try {
if (stripos(PHP_OS, 'win') === false) {
$options = getopt('m::');
if (isset($options['m'])) {
if ($options['m'] == 'always') {
$cronMode = 'always';
} elseif ($options['m'] == 'default') {
$cronMode = 'default';
} else {
Mage::throwException('Unrecognized cron mode was defined');
}
} else if (!$isShellDisabled) {
$fileName = basename(__FILE__);
$baseDir = dirname(__FILE__);
shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
exit;
}
}
Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
if ($isShellDisabled) {
Mage::dispatchEvent('always');
Mage::dispatchEvent('default');
} else {
Mage::dispatchEvent($cronMode);
}
} catch (Exception $e) {
Mage::printException($e);
exit(1);
}
我们正在尝试为在 ubuntu 服务器中运行的 magento 站点设置 cron
我们正在尝试以下命令:
*/5 * * * * php -f /var/www/html/sitename/cron.php
但我们收到如下错误:
-bash: */5: No such file or directory
更新 1
更新 2 - 错误
PHP Warning: require(app/bootstrap.php): failed to open stream: No such file or directory in /var/www/html/sitename/cron.php on line 30
PHP Fatal error: require(): Failed opening required 'app/bootstrap.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/sitename/cron.php on line 30
cron.php
<?php
// Change current directory to the directory of current script
chdir(dirname(__FILE__));
require 'app/bootstrap.php';
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
umask(0);
$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
$isShellDisabled = true;
try {
if (stripos(PHP_OS, 'win') === false) {
$options = getopt('m::');
if (isset($options['m'])) {
if ($options['m'] == 'always') {
$cronMode = 'always';
} elseif ($options['m'] == 'default') {
$cronMode = 'default';
} else {
Mage::throwException('Unrecognized cron mode was defined');
}
} else if (!$isShellDisabled) {
$fileName = basename(__FILE__);
$baseDir = dirname(__FILE__);
shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
exit;
}
}
Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
if ($isShellDisabled) {
Mage::dispatchEvent('always');
Mage::dispatchEvent('default');
} else {
Mage::dispatchEvent($cronMode);
}
} catch (Exception $e) {
Mage::printException($e);
exit(1);
}
此路径中有一个数据库文件:服务器中的 /var/www/db.sql。
我们的数据库大小约为 800mb。
我们必须将此 sql 文件上传到数据库:“age”
用户名:root,密码:pass,数据库密码:dbpass
我正在尝试这个命令。但它不工作。
mysql -u root -p pass age db.sql
我点击了这个链接:https ://stackoverflow.com/questions/19483087/importing-large-sql-file-to-mysql-via-command-line
请给出正确的命令
我们正在使用 ubuntu 服务器,我必须将文件夹从一台服务器移动到另一台服务器:
文件夹:
/var/www/html/demo5/site/app
到/var/www/html/1/10/site
(文件夹名称在哪里app
)主机名:
123.123
主机456.456
用户名:
abc
到用户名:xyz
我有 SSH 访问权限,但我不熟悉这些命令。
我已经尝试过此链接,但由于我不熟悉命令,所以无法正常工作。