Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Cronix's avatar

I'd remove all of the ssl stuff until you get the basic site working. And this is why Taylor made Laravel Forge.

1 like
lara28580's avatar

Did it, removed apache so I thought ssl stuff would be removed as well?

D9705996's avatar

@SmokeTM - I had a look at your httpd configuration and cannot see anything too concerning. The one last thing i can think to try is to rule out any issues with the default directory settings in httpd.conf for /var/www/html.

Can you create a new directory with mkdir -p /var/www/cryptonews/public

Then create a new file in /var/www/cryptonews/public/phpinfo.php with the contents

<?php phpinfo();

Make sure you change the ownership of all the files and directories to the apache user & group using chown -R apache.apache /var/www/cryptonews/

Now amend your VirtualHost in /etc/httpd/conf.d/cryptonews.conf

<VirtualHost *:80>

  DocumentRoot "/var/www/cryptonews/public"
  ServerName www.cnews.at
  ServerAlias cnews.at

  <Directory "/var/www/cryptonews/public">

    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.html$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.html [L]

  </Directory>
</VirtualHost>

Restart apache and check if you can navigate to http://www.cnews.at/phpinfo.php

Let me know once you have made the changes and I can check if I can see this page.

1 like
lara28580's avatar

Made the changes you can now look at the page, but nothing changed problem persists..

D9705996's avatar

Good news - when I goto http://www.cnews.at/phpinfo.php its not a 404

however I am seeing <?php phpinfo(); /> Could you remove the trialing /> (sorry my typo earlier).

Can you also reinstall mod_php as this looks to have been removed earlier yum -y install mod_php then restart apache.

1 like
D9705996's avatar

@SmokeTM - awesome we are getting somewhere. Now can you copy your previous code folder to the new location

rm -rf /var/www/cryptonews
mv /var/www/html/CryptoNews /var/www/cryptonews
chown -R apache.apache /var/www/cryptonews
systemctl restart httpd 

This should put your application in the correct place for apache to serve the contents of the laravel public directory. It might show errors but we will get to that.

Let me know once complete

1 like
Cronix's avatar
chown -R apache.apache /var/www/cryptonews

should use apache:apache with a colon to separate the user from the group

1 like
lara28580's avatar

you want me to do cryptonews in the www folder? because the move command does not work no such directory!?

D9705996's avatar

@Cronix - You can use either dot or colon as the user/group delimiter for chown

1 like
D9705996's avatar

@smokeTM - Ive lost track of your folder structure. Can you please paste the output of

tree -d -L 4 /var/www

You might need to run yum install -y tree if the command isnt installed.

1 like
Cronix's avatar

Interesting. I've never seen dot syntax used anywhere before lol. Even the manual for chown shows using colons and no mention of dot.

1 like
lara28580's avatar

Looks good

/var/www
|-- cgi-bin
|-- cryptonews

@Cronix used : instead of . now is that ok?

D9705996's avatar

@SmokeTM - OK we are now getting a laravel 500 error. Can you see why in storage/logs/laravel.log

1 like
lara28580's avatar

Yop I think it has something to do with msql "The server requested authentication method unknown to the client". I set up a new user and granted all privilegs for the database but it doesnt work I think

D9705996's avatar

Did you do FLUSH PRIVILEGES in MySQL command line after creating the user.

1 like
Cronix's avatar

You're probably using mysql v8. Switch to 5.7.x, or add this modes array to your database connection config. That will only work for v8 though, so if you upload it to a server using 5.7 it will probably break it.

        'mysql' => [
            'driver'      => 'mysql',
            'host'        => env( 'DB_HOST', '127.0.0.1' ),
            'port'        => env( 'DB_PORT', '3306' ),
            'database'    => env( 'DB_DATABASE', 'forge' ),
            'username'    => env( 'DB_USERNAME', 'forge' ),
            'password'    => env( 'DB_PASSWORD', '' ),
            'unix_socket' => env( 'DB_SOCKET', '' ),
            'charset'     => 'utf8mb4',
            'collation'   => 'utf8mb4_unicode_ci',
            'prefix'      => '',
            'strict'      => true,
            'engine'      => null,
            'modes'       => [
                'ONLY_FULL_GROUP_BY',
                'STRICT_TRANS_TABLES',
                'NO_ZERO_IN_DATE',
                'NO_ZERO_DATE',
                'ERROR_FOR_DIVISION_BY_ZERO',
                'NO_ENGINE_SUBSTITUTION',
            ],
        ],
1 like
lara28580's avatar

That is really strange it worked already with v8 ..yop I did FLUSH PRIVILEGES So what should I do now install v5?

lara28580's avatar

Didn't change anything exception persists. Strange is that it worked already with v8 and now it throughs an exception maybe msql configs are broken? Reinstall could propably solve it

D9705996's avatar

@SmokeTM -

You issue might be related to you using the root account before and I guess a lesser privileged account now.

I have zero experience with MySQL 8.0 so not really able to help. Unless there is a feature you need from v8.0 you could uninstall and install latest v5. That I can help with.

Just make sure if you have any databases on the server that you need you back them up first!

1 like
lara28580's avatar

@D9705996 Thank you very much for all your help and time you spent to get this to work. I now have to remove msql 8 and install msql 5. Is there a quick guide to do this?

D9705996's avatar

The documentation says its not possible to downgrade.

You are going to have to uninstall the current software. this depends on how you installed it initially. If you used yum you should just be able to do yum remove <packagename>. I'm not sure what this is for mysql8 but you can find out by running

rpm -qa | grep -i ^mysql to see all installed mysql packages.

You can then install mysql 5.7 by doing yum install mysql mysql-server. You just need to be careful it doesnt try to reinstall the newer version (Did you at any point add a software repository for MySQL? - If so remove the corresponding .repo file from /etc/yum.repos.d/ and run run yum clean all before retrying yum install mysql mysql-server

1 like
lara28580's avatar

If I use yum install mysql mysql-server it installs mariadb but I wanna have msql 5.7 or what do suggest?

Always get Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. if I wanna start the msql server

D9705996's avatar

Don't worry that CentOS is installing mariadb. They have obsoleted the mysql packages for mariadb. For all intents and purposes they are the same. Once installed you can do

systemctl start mariadb.service
systemctl enable mariadb.service
1 like
lara28580's avatar

I have now installed msql 5.7 when I do

systemctl start mysqld.service

Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

D9705996's avatar

The output tells you how to get more info on why mysql couldnt start journalctl -xe

However the service name isn't mysqld anymore - you need to chnage mysql to mariadb

systemctl start mariadb.service
systemctl enable mariadb.service // You omnly need to do this once to ensure the DB starts on reboot

The mysqld service might still exist from teh MySQL 8 so might be rebooting your server at some point soon just to clear up any running processes/open files from all of the changes

1 like
lara28580's avatar

Nope restarted server used the commands error persists.... I really get tired ;(

Edit:

 Active: failed (Result: exit-code) since Wed 2018-10-10 23:13:30 CEST; 1min 1              3s ago
  Process: 735 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exit              ed, status=1/FAILURE)
D9705996's avatar

Can you open two terminals and in one run tail -f /var/log/mariadb/mariadb.log and in the other do systemctl start mariadb, do a CTRL +C in the tail terminal and paste the output here.

1 like
D9705996's avatar

@SmokeTM - one possible solution is to run

yum remove -y mariadb  mariadb-server mysql  mysql-server
rm -rf /var/lib/mysql
yum install -y mariadb mariadb-server
systemctl start mariadb

This will remove all of the file in the mysql lib dir which is where the databases files are stored by default, but you did backup your DBs before removing mysql8 right.

1 like

Please or to participate in this conversation.