92

MySQL 5.7.5+ changed the way GROUP BY behaved in order to be SQL99 compliant (where in previous versions it was not). There is a good overview of the changes here. Unfortunately, this affects some core queries that Craft uses when fetching elements. The good news is that this has been fixed already in Craft 3 since we refactored the way that elements ...


40

Updated 05/03/16: I had a struggle getting this to work with Homestead 5.2. The MySQL error everyone else is seeing, as well as mcrypt error, as mycrypt is not installed by default in Vagrant box laravel/homestead 0.4.1 (Fixed in vagrant box laravel/homestead 0.4.2 — See answer history for 0.4.1 how-to). So, steps to success: vagrant ssh into your box sudo ...


18

To fix this I have created a .my.cnf in my home-directory with the following content: [mysqld] sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


14

I might be shooting in the sky, but make sure that in your in your .htaccess you have RewriteBase / after RewriteEngine On


14

After playing with this a little further it seems the unixSocket setting is necessary to get this working so I added: 'unixSocket' => getenv('DB_SOCKET') To config/db.php and then added: DB_SOCKET="/Applications/MAMP/tmp/mysql/mysql.sock" To my .env file. After that, the installation will go through using the CLI. Perhaps there's still an option that ...


13

I gave everything a try, but the only thing that worked for me was ensuring "Allow network access to MySQL" was ticked in MAMP. Screenshot: http://c42.co/Ur30EJ


11

For UBUNTU 16.04 LTS commands: cd /etc/mysql sudo nano my.cnf add these two lines: [mysqld] sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' save file and reset your computer.


8

We have the same problem. MySQL version (Ver 14.14 Distrib 5.7.9, for osx10.11 (x86_64) using EditLine wrapper) Had problems SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression and by adding the code at my.cnf file resolved it for me: [mysqld] sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,...


6

Here are some fairly specific instructions if you happen to be hosted on a server configured through ServerPilot. https://serverpilot.io/community/articles/how-to-disable-strict-mode-in-mysql-5-7.html


6

Very likely it cannot connect to the database; that's typically what the 503 error is about: https://httpstatuses.com/503 ...so check the credentials in your .env file, and make sure that the version of MySQL that your website is using is the internal MAMP MySQL, and not the system-wide MySQL (if any). This video may help you: Installing Craft CMS v3 with ...


6

If you've just imported a database, it could mean your project.yaml is out of sync in your environment. I fixed this by running the CLI command: ./craft project-config/sync


5

On the main MyPluginPlugin class, there is a method you can override called onAfterInstall(). Which will run after your plugin is installed. To create those records, you can place the following code into the method: public function onAfterInstall() { $record = new MyPlugin_ExampleRecord; $record->setAttribute('attributeName', 'value'); $...


5

Others have said what the problem is, but in the interest of clarity for future readers... Cause: The database is expecting a newer version of Craft's filesystem than you have. Solution: Replace the /app folder with one from a fresh Craft download and visit your admin trigger URL


5

I was just confronted with this too. You most likely need to specify the unixSocket attribute for the MAMP Pro database. Take a look at my problem and solution at Craft CLI RC1 Connectivity Issues with MAMP Pro. Though if you're not able to get it working at all even manually I would definitely suggest resetting your root password in MAMP Pro as well.


5

So the way I'd recommend doing it is that you use .gitignore to exclude your /vendor directory from the repo; a good starter .gitignore file can be found here: https://github.com/nystudio107/craft-scripts/blob/master/example.gitignore Then you'll work on it in local dev, update Craft/plugins in local dev, and on deploy to production have it do composer ...


5

Finally figured out how to edit this index.php file if you're not able to point your document root to the web folder, or if you are forced to put craft in the folder private_html that shared hosters tend to use (or any other given structure above root) In the index.php file you only need to edit this line: define('CRAFT_BASE_PATH', dirname(__DIR__)); If ...


4

The short answer is, we should probably update that :) The long answer is: The homepage is a “Single” section, and originally, Singles couldn’t have dynamic Title fields like Channel and Structure sections; their titles were static, based on the section’s name. So in this case, that Homepage entry’s title was “Homepage”, and the only way to change that ...


4

The specific directive to disallow the /craft/ directory isn't necessary if your craft folder is below the webroot. However, it's good practice to have a robots.txt for each site, so I don't recommend deleting it altogether. You can change the directives to fit whatever robots criteria you need for your site. (For example, if you launch a beta site, you'd ...


4

In case it helps someone, my issue was the permissions for the root index.php file...It was 666 (writeable by group) and when I switched that file permissions to 644, the installation was able to move forward.


4

MySQL 5.7.5+ changed the way GROUP BY behaved in order to be SQL99 compliant (where in previous versions it was not). Either modify the existing mysql queries to be compatible to the new mysql version or make mysql behave as in previous versions , by executing the below queries on the mysql . SET sql_mode = ''; // current client SET GLOBAL sql_mode = '';...


4

The proper fixes have already been answered here; but I'd like to note that another fix is to use MariaDB instead of MySQL. It's a drop-in replacement for it, it's more performant for a number of metrics, and it's created by the original author of MySQL. Give it a go; you won't regret it.


4

Goodness, I figured out what was going on here. The cpTrigger had been changed from admin to a different name in the craft/config/general file. [Facepalm]


4

It depends what you are most comfortable with. PHP and Apache are shipped with macOS by standard but you'd still need to install and configure MySQL (or MariaDB etc), along with manual virtual host configuration. MAMP makes it much easier but sandboxing it all in one easy to install package with a GUI so if you're not comfortable with the command line and ...


4

First, I can positively confirm I have Craft running on two not hosted, local servers - one a Ubuntu 14.04 (well, Mint) installation, and one a Windows box using Uniserver. Not sure quite what you're reading - and I think you might be misinterpreting what you're reading - but just about every dev around here will have a local install they work on, one way ...


4

Talked with Justin via DM on the Craft Slack. As per that discussion, here was the solution: The Valet docs are extremely misleading. When detailing how to use the park command, they list running laravel new blog as one of the steps. This command has to do with creating a Laravel site and is not necessary at all (and in fact, as seen in this instance, ...


3

I faced this problem when I upgraded MySQL to version >= 5.7.5 and I'v fixed it by following these steps: SSH into your server. Add sql-mode="" to your MySQL config: echo -e '[mysqld]\nsql-mode=""' | tee --append /etc/mysql/conf.d/craft.cnf > /dev/null Restart MySQL service: service mysql restart Note: you might need to add sudo to those commands.


3

I'm not sure if this helps, but here is how I (attempt) to manage deployments/installs. I first create a user so I'm not using the root account. I tie that user to the apache user group. We'll call him 'user1'. I use beanstalk to deploy, and the deployment credentials are for 'user1'. Once all of the files have deployed for the first time, I'll log into ...


3

I think it's there to protect those who can't have craft/ below web root. In your case it can't be found by search engines, so you can delete it.


3

Thanks for the advice guys. It's helped me rule out the directories being an issue (sort of). Turns out that I was able to access the files in the craft directory all along. My issue related to the database settings. Typically, the 'server' setting in the 'craft/config/db.php' folder is set to 'localhost'. But for GoDaddy you need to use your hostname. Get ...


3

Even thought this is an old thread, I recently ran in to the same problem. It turned out to be a PHP version issue. I was running MAMP with PHP 7.0.0, once I switched that host to 5.6.10 it worked perfectly.


Only top voted, non community-wiki answers of a minimum length are eligible