mecha-cms / start

Installer.
6 stars 0 forks source link

Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in mecha-cms.de/engine/kernel/state.php on line 1 #2

Open ghost opened 1 year ago

ghost commented 1 year ago

Good morning, Tovic,

the installer trough /start.php going not done. My hosting is great prepared for the installation, but It's nothing possible over /start.php.

I have PHP 7.3 or 7.4 and an Apache web server at my hosting.

Can you help me with this?

Many thanks, Tovic :-)

taufik-nurrohman commented 1 year ago

The .\engine\kernel\state.php file should contain only the class definition. Also, why does it show an error on the first line? The first line is always a <?php opening tag.

Please paste the generated error log here in case it does exist.

taufik-nurrohman commented 1 year ago

Oh, could you try to disable the source code optimization and see if it works? It shows the error on the first line because the file content is compressed into a single line. Must be caused by the attribute syntax that it is being treated as a literal comment in PHP < 8.0.

ghost commented 1 year ago

Hi,

I'm trying to install in an SSD hosting too, but that errors are visible:

✘ Could not pull mecha-cms/mecha due to network error.

✔ It looks like you are using a LiteSpeed web server. This web server is usually compatible with Apache web server configuration.

✔ Minimum PHP version required is 7.3.0. Your current PHP version is 7.4.33.

✔ PHP [dom](https://mecha.officiis.biz/start.php) extension is enabled.

✔ PHP [json](https://mecha.officiis.biz/start.php) extension is enabled.

✔ PHP [mbstring](https://mecha.officiis.biz/start.php) extension is enabled.

Always a network error and the installer without code optimizing still not worked.

taufik-nurrohman commented 1 year ago

Always a network error […]

Make sure allow_url_fopen option is enabled.

[…] and the installer without code optimizing still not worked.

What’s the new error message appears after you disable the code optimizer? I need the exact code line information from the uncompressed file.

ghost commented 1 year ago

PHP is 7.3.x, allow url fopen is active and I have this error:

✘ Could not pull mecha-cms/mecha due to network error.

It's always only that error I show at Firefox browser under https://mecha.officiis.biz . I want to move, if the installation it's done, to the main domain under https://mecha-cms.de .

taufik-nurrohman commented 1 year ago

Must be from my side. Why not try to install it the manual way? There’s an experimental website available to visit here: https://dev.mecha-cms.com. You can download the ZIP file directly from the home page.

The dev. prefix will be removed once everything is stable.

ghost commented 1 year ago

Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in mecha.officiis.biz/engine/kernel/state.php on line 1

So now, I'm trying with the code optimization. It's the same error, I think.

taufik-nurrohman commented 1 year ago

I need it without the code optimization to get the exact code line from the uncompressed file.

ghost commented 1 year ago

Ah, ok, I want always to install my CMS via browser way :-) It's ok, I want to try this now. Wait, please just a moment, OK.

ghost commented 1 year ago

Now, I had uploaded from your source the packet with mecha CMS and under https://mecha-cms.de I see that error:

Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /mecha-cms.de/engine/kernel/state.php on line 1

PHP is 7.4.x and allow url fopen is active.

taufik-nurrohman commented 1 year ago

Why it is always on line 1? Have you unchecked the “Minify PHP” input before downloading the package?

ghost commented 1 year ago

So now a new error by the name of:

Fatal error: Declaration of Page::__toString() must be compatible with File::__toString(): string in /home/mecha-cms.de/lot/x/page/engine/kernel/page.php on line 44

I have uploaded the mecha again, and I have unchecked the "Minify PHP".

taufik-nurrohman commented 1 year ago

Okay, I know this part. For now, please go to .\engine\kernel\file.php then replace public function __toString(): string { with public function __toString() {.

ghost commented 1 year ago

Ok, now it's all fine, and I have removed this site from Cloudflare, because it's not worked with Cloudflare. I think, that is by the side of Cloudflare, you know, Tovic.

In the next a couple of hours will be the DNS done and after that we will know more about my Mecha CMS website :-).

ghost commented 1 year ago

The new error is from Firefox browser and I don't know, what is that:

Content-Encoding-error in the last version of the browser. See: https://mecha-cms.de Thanks, Tovic!

taufik-nurrohman commented 1 year ago

It shows content encoding error because there’s an error when printing the response body. When this happen, usually a log file will be available as .\engine\log\error, .\engine\log\error-x or .\engine\log\error-y.

ghost commented 1 year ago

Hi Tovic,

I have shown in the error.log file and have found that error:

[04-Apr-2023 19:27:29 Europe/Berlin] PHP Warning: Declaration of Page::name(...$lot) should be compatible with File::name($x = false) in /mecha-cms.de/lot/x/page/engine/kernel/page.php on line 99

I'm trying both PHP versions like 7.3.x and 7.4.x, and it's the same error. So I don't know what I can now do. Can you help me again with mecha? `

taufik-nurrohman commented 1 year ago

Open ./index.php then change the TEST constant value to false:

define('TEST', false);

This does not happen with PHP 8.x.x though.

ghost commented 1 year ago

I have uploaded old files of mecha CMS of the version 2.6.3 to mecha-cms.de and now in the backend I have shown that error:

[30-Oct-2021 07:31:17 Europe/Berlin] PHP Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in ./lot/x/search/engine/r/route.php on line 1

How I can fix this? PHP is 7.4.x. Many thanks for the help, Tovic!

taufik-nurrohman commented 1 year ago

Please download the uncompressed version of mecha-cms/x.search extension so that I can know exactly where the code line is. FYI, the mecha-cms/y.normal layout is not yet compatible with Mecha 3.0.0.

ghost commented 1 year ago

Good morning, Tovic,

now it's everything fine with my mecha website. I have now uploaded your mecha version 2.6.3 with the default layout, which working fine. And thanks for all the help to me!

taufik-nurrohman commented 1 year ago

Yeah, sorry about that. Version 3.0.0 is not yet stable and not ready for production. But once it stable, there will be more extensions and layouts available.

taufik-nurrohman commented 1 year ago

@AlexL777HRO could you try again the start.php file with the latest update?

ghost commented 1 year ago

Hi, ok, thank you I will check it today at later evening :-)