I'm completely new to the Akelos framework, but I am familiar with PHP. When I came across the framework I knew it was exactly what I was looking for but for the life of me I cannot get it to install properly.
Here are the steps that I went through and the details of my environment:
I am on a Mac Intel, using MAMP as my main environment
I have copied the Akelos files into my project folder.
When I navigate to localhost:8888 (as setup by mamp) I first get this error message:
(Warning) Cannot modify header
information - headers already sent by
(output started at
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/public/index.php:50)
But when I refreshed the page that warning disappears and I successfully obtain the Akelos Getting Started page
I setup the database configuration, and proceed
I successfully set the language settings
First I get the following error:
(User Error) Could not create or alter
table akelos_migrations using the SQL
CREATE TABLE akelos_migrations ( id
INTEGER NOT NULL AUTO_INCREMENT, name
VARCHAR(255), version
INTEGER, updated_at
DATETIME, created_at
DATETIME,
PRIMARY KEY (id) )TYPE=InnoDB
When I refresh - everything "appears" to work fine and I am taken to to the "Welcome Aboard" page
When I try to run Script / Generate I get the following message:
Warning: mysql_connect(): [2002] No
such file or directory (trying to
connect via
unix:///var/mysql/mysql.sock) in
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/vendor/adodb/drivers/adodb-mysql.inc.php
on line 353
Warning: mysql_connect(): No such file
or directory in
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/vendor/adodb/drivers/adodb-mysql.inc.php
on line 353
Fatal error: Connection to the
database failed.
mysqlt://salman:******#localhost/socialPM_dev
in /Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/lib/AkActiveRecord/AkDbAdapter.php
on line 66
This happens even if I try to manually create the akelos_migrations table using phpMyAdmin and SQL.
I would love to be able to use this framework - but I absolutely can't get past this!
Well the mysql socket file isnt usually in /var/mysql/mysql.sock on OS X. If you use the Mysql install from Mysql then its in /tmp/mysql.sock by default... The macports version is in /opt/local/var/run/mysql5/mysqld.sock by default. Im not sure where it is in MAMP because i dont use it, but my guess would be somewhere on the MAMP folder structure. You need to find out where it creates its socket and supply the path to it to your conifguration (i assume thats an option on the DB setup screen).
Related
I'm trying to create my first SilverStripe website following this tutorial.
So far I have created my website and configured my .env page.
# DB credentials
SS_DATABASE_CLASS="MySQLDatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
SS_DATABASE_NAME="SS_examples"
SS_ENVIRONMENT_TYPE="dev"
I'm not sure entirely how the database is created when creating a site. I checked my databases and I do not have one for it. I can make one manually but I wasn't sure if I should and list it under SS_DATABASE_NAME, or if it will auto-create the db.
I'm assuming this is why when I visit my local site localhost/SSexample/public I get an error saying "The website server has not been able to respond to your request".
Am I missing a step in setting up the site or should I manually create a db named SS_examples?
on a side note my apache server is set up with xampp and my SilverStripe project is in C:/xamp/htdocs.
Steps I took to create site:
Built site in C:\xampp\htdocs by running: composer create-project silverstripe/installer SSexample
Visited my project by going to localhost/SSexample/public
created .env file as listed above
ERROR LOGS
[2019-12-31 22:29:22] error-log.ERROR: Uncaught Exception SilverStripe\ORM\Connect\DatabaseException: "Couldn't run query: SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SilverStripe\\SiteConfig\\SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1 Table 'ss_lessons.siteconfig' doesn't exist" at C:\xampp\htdocs\SSlessons\vendor\silverstripe\framework\src\ORM\Connect\DBConnector.php line 64 {"exception":"[object] (SilverStripe\\ORM\\Connect\\DatabaseException(code: 0): Couldn't run query:\n\nSELECT DISTINCT \"SiteConfig\".\"ClassName\", \"SiteConfig\".\"LastEdited\", \"SiteConfig\".\"Created\", \"SiteConfig\".\"Title\", \"SiteConfig\".\"Tagline\", \"SiteConfig\".\"CanViewType\", \"SiteConfig\".\"CanEditType\", \"SiteConfig\".\"CanCreateTopLevelType\", \"SiteConfig\".\"ID\", \n\t\t\tCASE WHEN \"SiteConfig\".\"ClassName\" IS NOT NULL THEN \"SiteConfig\".\"ClassName\"\n\t\t\tELSE 'SilverStripe\\\\SiteConfig\\\\SiteConfig' END AS \"RecordClassName\"\n\r\nFROM \"SiteConfig\"\n\r\nLIMIT 1\n\nTable 'ss_lessons.siteconfig' doesn't exist at C:\\xampp\\htdocs\\SSlessons\\vendor\\silverstripe\\framework\\src\\ORM\\Connect\\DBConnector.php:64)"} []
It seems that the installer at localhost/SSexample/public should allow you to configure your database connection settings (and create the database for you).
Getting The website server has not been able to respond to your request error means that you have a problem with webserver - is it running?
EDIT: The website server has not been able to respond to your request is actually Silverstripe's generic error 500 message.
EDIT2: one has to enable dev environment - by adding SS_ENVIRONMENT_TYPE="dev" to .env file and then access localhost/SSexample/public/dev/build to get database created and populated.
As mentioned by others (Ref 1,
Ref 2 and Ref 3) the current phpMyAdmin version (4.8.2) + MySQL 8.0.11 + PHP 7.2.8 doesn't work as expected.
The error happens when you try to open phpMyAdmin, where it shows an error message:
#2054 - The server requested authentication method unknown to the client
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client
As stated in MySQL migration manual here, and described as the solution in Ref 2, you can correct this by executing the following mysql query inside docker:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'ROOTPASSWORD';
(In order to run this, I use docker exec -it CONTAINERID bash and execute mysql command)
And it works. The main problem is that I need to fire this query as soon as the container starts (the current method is manual and far from scalable). I assume it's possible in different ways:
By executing a PHP script that runs the query after everything has been setup (IMO this is unsafe )
By running the above command in a bash after everything has been setup
The first one is unsafe IMO as the mysql user must have high privileges, although there will be only the root user when this script runs. I haven't tested it yet.
The seconde one is the best IMO, but I can't figure it out how to implement using Dockerfile, as everything I type there runs BEFORE mysql and phpMyAdmin are installed. How could I achieve that?
My current Dockerfile can be seen here and the docker-compose.yml can be seen here.
As a simple solution, you can build your custom mysql image and run the command there. Then mysql will start with this modification already in place.
I have a database file on my computer called testing.sqlite, which contains a copy of me database that I want to use for testing (rather than connecting to my ordinary MySQL production server).
I created an entry in the config/database file in laravel as instructed, setting it to access the sqlite file, and it all look right. But when I try and actually do anything, I get the error message:
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database (SQL: select * from sqlite_master where type = 'table' and name = vendor_alerts)
I can access the file using sqlite testing.sqlite from the command line, why can't laravel read it?
The problem is that the version of sqlite is different. Laravel uses sqlite3, wheareas the sqlite command on your console might be an earlier version. Run sqlite -version from the command line to check your version - is is probably 2 something. You need to install sqlite3, and you'll find that it is not compatible - i.e. sqlite3 testing.sqlite will produce the same error you are getting from laravel.
So, upgrade your command line sqlite version, and copy the data into a new sqlite3 database, and laravel will work without trouble.
I want to transfer a system to the other server with the deterioration of the server that a certain system works.
After transferring a program file and a database to a new server, an error occurs.
■Error contents
Warning (2): pg_query() [function.pg-query]:
Query failed: ERROR: An input sentence structure of model integer is invalid: "\x3234"
LINE 1: ...Aro0"."model" = 'User' AND "Aro0"."foreign_key" = '\x3234' ...
^ [CORE\cake\libs\model\datasources\dbo\dbo_postgres.php, line 148]
※Original Message(in japanese) : Query failed: ERROR: 型integerの入力構文が無効です: "\x37"
For environment
(former)
PHP: 5.2.13
CakePHP: 1.2.7
Apache: 2.2.15
Postgre: 8.4.4-1
(newly)
PHP: 5.5.15
CakePHP: 1.2.7
Apache: 2.4.10
Postgre: 9.2.9.1
I copied a program file from an old server after installation of PHP and Apache and PostgreSQL.
※I changed the connection server to the new server in database.php
※I describe php.ini, httpd.conf to become the setting same as an old server
Login screen (index.php) coming to be displayed,
and inputting ID and a password, and running login processing, the errors occurred.
The real error is ""foreign_key" = '\x3234'" part
that only numerical value guesses character string called"'\x3234'" right in foreign_key.
Only the number to 2 figures is really registered with the item equal to foreign_key even if I confirm a database.
Foreign_key which the login user has is "24",
but seems to be treated in one of login processing as "'\x3234'".
After doing it I tryed to login in other login users,
9 ⇒ '\x39'
7 ⇒ '\x37'
23 ⇒ '\x3233'
24 ⇒ '\x3234'
The left is foreign_key, and the right is really used by SQL.
A head has "\x3", and there seems to be "3" before the second column when there are two columns.
Is there any differents for settings of PHP/CAKEPHP/APACHE/POSTGRESQL ?
I am trying to setup a drupal web server with FreeBSD.
When I try to access the drupal index i am greeted with:
Fatal error: require_once(): Failed opening required
'/usr/local/www/apache24/data/drupal/includes/database/sqlite/database.inc'
(include_path='.:/usr/local/share/pear') in
/usr/local/www/apache24/data/drupal/includes/database/database.inc on
line 1685
I am new to freeBSD but i tried setting chmod 667 to the:
sqlite/database.inc
database/database.inc
sqlite
database
Also, i do not understand why it is looking for /usr/local/share/pearas there is no such directory.
I am using MySQL55, PHP5, Drupal-7, and Apache.
I think this might be related but when i access the install.php i get:
Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 201 of /usr/local/www/apache24/data/drupal/includes/install.inc).
did you use drush?
That looks as if you already installed drupal, or at least drupal thinks so. and also with the wrong database settings. normally, you will be prompted to enter them in the web interface, but you also can enter them directly in the settings php. Propably you should just move the old settings.php and run install.php in your browser and enter the database details anew.
drupal_install_profile_distribution_name can be changed in the database under system->standard_profile and variable->install_profiles directly or using drush (www.drush.ws) with
vset install_profile standard
or any other install profile you used.
Anyways, the install script asks for that as well.
hope, this was your problem.