White Screen When Accessing 192.168.33.10/App with Vagrant+CakePHP

Asked 2 years ago, Updated 2 years ago, 128 views

Vagrant synchronizes local folders to create a development environment, but when you access http://192.168.33.10/App, the screen turns white.

If possible, I would like to set http://192.168.33.10/ to Document Root instead of the App directory, so I would like to use the /etc/httpd/conf/httpd.conf file

<Directory"/var/www/html/App">
  Options Indexes FollowSymlinks
  AllowOverride All
  Order allow, deny
  Allow from all
</Directory>

When I try changing to , the screen turns white.

The directory structure is as follows:
/home/vagrant/[appName]/App

Within [appName]
App Plugin Vagrantfile Vendor composer.json composer.lock

In App
Config Console Controller Lib Model Plugin Test Vendor View index.php webroot

and
in the Vagrantfile. config.vm.synced_folder"/Users/hoge/Vagrant/[appName]/", "/home/vagrant/[appName]"
Configuring synchronization in .

I would appreciate it if you could give me a professor who knows how to solve this problem.

Note: The following versions are available:
Max OSX Yosemite
Vagrant 1.7.2
Box CentOS 64 Apache Apache/2.2.15 (Unix)
cakePHP2.7.2

///////
DocumentRoot"/var/www/html".

cakephp apache vagrant

2022-09-30 19:10

2 Answers

This may be because the Apache httpd document route is not set to CakePHP webroot.

As apache configuration,

 DocumentRoot/home/vagrant/[appName]/App/webroot

<Directory"/home/vagrant/[appName]/App/webroot">
  Options FollowSymlinks
  AllowOverride All
  Order allow, deny
  Allow from all
</Directory>

and

Also, if the permission of /home/vagrant is 0700, change it to 0755.

The above is a temporary measure.
Since the virtual environment should be configured the same as the production environment, the sync_folder setting is

config.vm.synced_folder "/Users/hoge/Vagrant/[appName]/", "/var/www/[appName]"

It would be better to set DocumentRoot to /var/www/[appName]/App/webroot.


2022-09-30 19:10

Is there a possibility that you are using <? even though the short_open_tag is not true? In that case, the screen is white, but if you look at the source in your browser, you can see the source of php.

Also, there is an extra blank at the end or head of one of the library-like php sources.Before <?php at the beginning or after ?> at the end.If there is an extra blank, the blank may appear as body before the header output and the screen may turn white.


2022-09-30 19:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.