【发布时间】:2016-04-04 04:04:23
【问题描述】:
修复可能很容易,但我花了 4 个小时试图找到它。 这是我第一次使用 Laravel。我在 Debian 8 上设置它。 安装此工作所需的所有模块。 问题是 php 显示为文本。
到目前为止我尝试了什么:
sudo apt-get update
apt-get install curl
sudo apt-get install -y build-essential
sudo apt-get install -y python-software-properties
sudo apt-get install -y php5
sudo apt-get install -y apache2
sudo apt-get install -y libapache2-mod-php5
sudo apt-get install -y mysql-server
sudo apt-get install -y php5-mysql
sudo apt-get install -y php5-curl
sudo apt-get install -y php5-gd
sudo apt-get install -y php5-mcrypt
sudo apt-get install -y git-core
sudo apt-get install -y phpmyadmin
apt-get install unzip
curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -
apt-get install --yes nodejs
apt-get install --yes build-essential
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo apt-get update
sudo apt-get install tcl8.5
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
cd utils
sudo ./install_server.sh
Changed the document root here: /etc/apache2/sites-avialable
From DocumentRoot /var/www/html to DocumentRoot /var/www/html/public
Added this to the apache config.
Include /etc/phpmyadmin/apache.conf
/etc/redis/6379.conf
Uncommented:
#bind 127.0.0.1
bind 127.0.0.1
service redis_6379 restart
service apache2 restart
【问题讨论】:
-
您是否已经将文件放入
/var/www/html/public以查看 Apache 是否正常工作? -
apache2重启成功了吗?我看到你在重启服务时错过了sudo -
@GuyT 是的,这就是问题所在。 prntscr.com/9k6bfl
-
@Raptor 是的,我尝试使用 sudo 重新启动。
-
只要在
<?php echo 'hello world'; ?>所在的文件夹中放一个简单的index.php就可以检查Apache是否启动了。
标签: php apache laravel redis debian