CakePHP on a Windows Plesk Shared Server

I am wondering if CakePHP can be made to work on a shared Windows Plesk server?

I extracted the CakePHP files to the / httpdocs / folder and created the web.config file according to the instructions in the CakePHP docs, however all I look for is "Internal Server Error". Should I also have the MySQL database setup before viewing the base Cake configuration pages, or if it can show me something without any database configuration?

I set up my site to run PHP 5.4.32 (FastCGI).

The error is reported:

PHP Fatal error: you must enable the intl extension to use CakePHP. in C: \ Inetpub \ vhosts \ example.com \ httpdocs \ config \ bootstrap.php on line 38

However, my host said that they tried to include the path to the directory where php_intl.dll is present, but this did not solve the problem.

Greetings

Pete

+6
source share
4 answers

This is how you do it in Cakephp 2.x

After setting up the web space, you do not need to change or ruin the php configuration (as long as php is set as the default for this web space) and when you create web_space in Plesk, the Plesk server usually does everything for you .

But you need to configure CakePhp application on the Plesk server, you need to follow these steps:

  • Root directory

When you create a new DNS or Plesk web_space, create a directory structure for you, you need to place the application in the created directory and configure htaccess in these folders as follows (just add some "/" in the path):

CakePHP root directory (must be copied to your document; redirects everything to your CakePHP app and updated to): <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] #to=> /app/webroot/ RewriteRule (.*) app/webroot/$1 [L] #to=> /app/webroot/$1 </IfModule> CakePHP app directory (will be copied to the top directory of your application by bake): <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] #to=> /webroot/ RewriteRule (.*) webroot/$1 [L] #to=> /webroot/$1 </IfModule> CakePHP webroot directory (will be copied to your application's web root by bake): <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] #to=> /index.php </IfModule> 
  • Database

Of course, you will need to set up your database.

To do this, you need to configure a new database for your application on the plesk server, and then get:

  • Database IP
  • database name
  • database username
  • database password

and update the /Config/database.php application with the new database information. as you would know:

 public $default = array( 'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'ip address here', 'login' => 'database username', 'password' => 'database password', 'database' => 'database name' ); 

Here's how to configure Cakephp 3.x

Hope this helps

0
source

Should I also have the MySQL database setup before viewing the base Cake configuration pages, or if it can show me something without any database configuration?

No no. Even without pre-configuring db, the default page will load. It will just give you a message stating that db is not configured.

Invalid "intl" extension is your main problem. You have to fix it. I have no experience with plesk on windows, so you cannot handle it. Although I would recommend using a Linux-based server to simplify your life.

+1
source

The php_intl extension is disabled by default for each Plesk PHP handler:

You can include it in

 C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP54\php.ini 

Just find and uncomment this line:

 ;extension=php_intl.dll 
0
source

Thanks to everyone who answered my question.

I returned to CakePHP version 2.6.7 instead of 3.x and after following the instructions in a message from Fury, I was able to successfully make some progress and get the CakePHP base page to download.

Hopefully someone with a little knowledge can come up with a guide for those who want to run it from v3.x on Windows Plesk, as I noticed that there is a different directory structure, etc.

Greetings

Peter

0
source

Source: https://habr.com/ru/post/989176/


All Articles