Jump to content

Compile Error: Cannot redeclare class ProcessWire\InputfieldFieldsetOpen...


laplix
 Share

Recommended Posts

Hi folks,

ProcessWire newbie here, but not a total PHP newbie (kind of I know what I'm doing but i'm not a guru).

I cloned the github repo today. This is a new project that won't see the light of day for a while, so I figure this was the perfect project to learn ProcessWire and be at the edge,

Did git checkout -b devns and got 3.0.15

I then did a git checkout -b dev to work on my branch

I copied site-default/ to site/, copied htaccess.txt to .htaccess, did a chmod 777 site/assets site/config.php site/modules.

And started  the install process.

First page OK

Second page OK

Then I clicked Continue and got this :

Compile Error: Cannot redeclare class ProcessWire\InputfieldFieldsetOpen (line 17 of /home/laplix/www/html/test/wire/modules/Fieldtype/FieldtypeFieldsetOpen.module)

This error message was shown because: install.php still exists. Error has been logged.

Any idea what I'm missing?

Louis

Link to comment
Share on other sites

Hi, welcome to the forums.

I'm not sure what you have done with "git checkout -b devns" and afterwards with "git checkout -b dev", but dev and devns are two seaparate branches of Processwire.

dev is the 2.7.3+ dev branch, and devns is the 3.0.15+ branch. I'm not comfortable with git, but why do you checkout two times?

  • Like 1
Link to comment
Share on other sites

Thank you very much for your fast answer.

I think I went too fast writing my question and it seems the error I wrote got eaten by the board .

I cloned the 3.0.15 repo, then I did "git co devns" (no -b), then I started my own branch "develop" (not dev, again writing too fast).

The error I got was this:

Compile Error: Cannot redeclare class ProcessWire\InputfieldFieldsetOpen (line 17 of /home/laplix/www/html/test/wire/modules/Fieldtype/FieldtypeFieldsetOpen.module)

This error message was shown because: install.php still exists. Error has been logged.

But I was still in the installation process.

In another attempt, when I got that error, I removed install.php and got the same error except the reason given was that I had not yet logged in.

Sorry again for the misunderstanding

Link to comment
Share on other sites

Don't need to copy anything manually (like site-default to site), the installer will do this for you. All you have to do is check out your desired branch and access the installer through http. It will take care of creating the neccessary file system structure.

  • Like 1
Link to comment
Share on other sites

@BitPoet

This is weird...
I did 3 installations. The first one went OK, the second one went haywire and gave me the same error and the third one went OK again.

First, I went for a fresh install. I deleted my previous test installation, including the database.
Then I did this
git clone https://github.com/ryancramerdesign/ProcessWire.git test
Followed by git co devns to get the latest 3.x version
I made a branch from devns so I would not mess up devns since I will want to pull the repository every few weeks and merge it into laplix.
git co -b laplix

Then, I started the installation process, following your advice.
First page, I selected the site-default profile and clicked Continue
The next page showed me an error: File system is not writable by this installer. Before continuing, please rename '/site-default' to '/site'
So we do have to either rename site-default or copy it. It is not done by the installer. I copied it and clicked Continue.
Next page showed me some errors (needing to create .htaccess, making site/access, site/confg.php and modules writable).
I copied htaccess.txt to .htaccess and chmod 777 assets/ config.php modules/
I clicked to Check again and everything went green. I clicked Continue and went to the next page.
I setup the database credentials, changed nothing else and clicked Continue
The next page told me that everything went OK
I changed the Admin Logn URL to admin
Provided the user name, password and email for the superuser
Didn't do anything to the cleanup list since the files and directory could not be modified by the install script.
I clicked Continue
The next page warned me about my site/config.php and provided me the login form.
I logged in and got to the admin page with warning about install.php and file permissions in site/config.php

So, the site is installed and I am happy

Since that went well, I did it again following the exact same steps (I think) with the real site name (for example, site1) and even if I did everything as before for the test installation, I got the same error as before !!

Because I wanted to give as much details as possible, I did it again, writing down everything I did and this time, it worked?

Unless someone knows what could cause this error, I'll mark this as close since I can now work on my site. But I would really like to understand what's provoking this error.

The reason being that earlier, I had started my site with 2.7.2, the master branch. Wishing to use 3.x, I switched to devns.
Switching to devns, git told me I was 4 commits behind, so I did a git pull before installation. Again the error came up.

This make me fear keeping up to date with the repository. I do want to keep up to date with devns (maybe not every week but certainly every few weeks). I know that I will be subject to bugs but I don't care. This project will take some time to do since it's on my free time. And I'll report the bugs if any.

I just want to know if it's me making a mistake or not. A fresh install should be painless, no? In my case, I finally managed it with 7+ installations. Not so painless...

Again, thank you for your input.

Link to comment
Share on other sites

Not wanting to rain on your parade, but seeing that you are missing out on all the fun of playing with ProcessWire, I'd suggest that for starters you install ProcessWire the 'normal' way. Download a zip file and copy that to your server, unzip it, call that location in your browser and click through :-). Alternatively, get @Soma's online installer thingy (you can edit it to grab the version of PW you want) and it will do the downloading for you plus start the installation. Totally painless. Later on, if you are still up to it, you can play around with deploying via git :-)...

Just my 2p

Edit: Oops. welcome to the forums! (where's my manners, tsk, tsk) 

Edited by kongondo
  • Like 2
Link to comment
Share on other sites

The next page showed me an error: File system is not writable by this installer. Before continuing, please rename '/site-default' to '/site'

If the filesystem is not writeable, no one and nothing can do anything. :)

I suggest the same as @Kongondo. Grab you a ZIP of your desired branch (devns I assume), copy it to your server (local or online), make sure, at least your site/assets/{ALL_SUBFOLDERS} are writeable by the php-user. Then run the installer. :)

If you later on want to install a newer devns version, you have nothing more to do then to change the complete wire folder.

For example, if you have PW 3.0.15 now, rename your wire folder to wire.3015, copy/upload the wire folder of PW version 3.0.17 to your installation and login into the admin. That's it. Easy.

And yes: - Welcome to the forums. :)

Edited by horst
  • Like 2
Link to comment
Share on other sites

If you later on want to install a newer devns version, you have nothing more to do then to change the complete wire folder.

For example, if you have PW 3.0.15 now, rename your wire folder to wire.3015, copy/upload the wire folder of PW version 3.0.17 to your installation and login into the admin. That's it. Easy.

Even easier, if you install the Upgrades + Upgrades Checker modules in order to perform the upgrade with a few clicks (while reading the inline instructions carefully...)

  • Like 2
Link to comment
Share on other sites

Even easier, if you install the Upgrades + Upgrades Checker modules in order to perform the upgrade with a few clicks (while reading the inline instructions carefully...)

hhm, yes, but may be also: no.!? - At least, then you will need the php user to have filesystem write access, or not? :)

  • Like 1
Link to comment
Share on other sites

@kongondo, @horst, @BitPoet, Thank you for welcoming me.

OK, I tried soma installer and it work quite nicely, except

  1.  everything is the name of the apache user www-data, meaning I have to change the owner of the site/ directory and if I want to tinker with ProcessWire, I'll have to do that for the whole installation
  2. I got ProcessWire 2.7.2 instead of 3.0.15

I do want the 3.0.x branch, and I want to stay up to date with the branch. This why I used git. I'm ready to live with some bugs. This is mostly a learning project though some of it may go out later when the 3.0 branch goes beta or stable.

@horst, this is why, at first, I would copy site-default to site and chmod 777 access config.php and modules before starting installation. But on @BitPoet suggestion, I didn't do any of that before starting another installation. I did correct everything after these errors showed up.

Checking in install.php, I see in initProfile.php that it does try to rename the profile I chose. But since I clone the repository, the files belong to me, not to the apache user. So the installer is unable to create the site.

It will work with grabpw.php because it is the installer that creates the files. So they belong to the apache user.

Anyway, I finally manage to install my project with 3.0.15. Now, the fun part starts :-)

Yet, I would like to know why this error occurred. Maybe later, when I am familiar with the code, I'll hunt it down.

ProcessWire looks like an awesome framework, doing things in a completely different way compare to other frameworks and challenging the brain a bit. For example, I started designing my project, making the database schema and stopped right there realizing that PW is mostly about pages, templates and fields. No need for a full database design.

Anyway, I want to thank you all for taking the time to answer me. This looks like a very, very friendly community.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...