我在浏览器同步运行时遇到问题。当我运行 gulp sync 时,浏览器会在http://localhost:8080/app_dev.php网址上运行加载时停留的空白页。
我使用代理选项来使用php app(symfony)链接到我的本地服务器的虚拟主机。这是我的配置:
gulpfile.js
gulp.task('sync', function() {
browserSync.init({
proxy: 'progress_app.localhost/app_dev.php',
port: 8080,
open: true,
notify: false
});
});
的httpd.conf
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\progress_app\web"
DirectoryIndex index.php
ServerName progress_app.localhost
ServerAlias progress_app.localhost
<Directory "C:\xampp\htdocs\progress_app\web>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>