Comments (12)
You have to have PHP 5.3 installed to use the "DIR" magic constant:
http://php.net/manual/en/language.constants.predefined.php
To preserve compability with PHP 5.2 the developers would have to replace
"DIR" with dirname(__FILE__)
2013/8/18 Chris R. Albon [email protected]
I uploaded Pico but I only see a blank php page of death. After turning on
error reporting, I get this:Notice: Use of undefined constant DIR - assumed 'DIR' in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php on
line 5 Warning: require_once(DIR/composer/autoload_real.php): failed to
open stream: No such file or directory in /hsphere/local/home/livenoma/
writemorefaster.com/vendor/autoload.php on line 5 Fatal error:
require_once(): Failed opening required
'DIR/composer/autoload_real.php'
(include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php on
line 5I figured I had the wrong version of PHP, but I just checked and am
running 5.2.10. Any ideas?Here is my phpinfo: http://www.writemorefaster.com/test.php
β
Reply to this email directly or view it on GitHubhttps://github.com//issues/65
.
from pico.
Oh - it seems to be a composer problem. Since composer does not work with
5.2 it should be noted on the Pico home page somewhere.
2013/8/19 Max Gfeller [email protected]
You have to have PHP 5.3 installed to use the "DIR" magic constant:
http://php.net/manual/en/language.constants.predefined.phpTo preserve compability with PHP 5.2 the developers would have to replace
"DIR" withdirname(__FILE__)
2013/8/18 Chris R. Albon [email protected]
I uploaded Pico but I only see a blank php page of death. After turning on
error reporting, I get this:
Notice: Use of undefined constant DIR - assumed 'DIR' in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php on
line 5 Warning: require_once(DIR/composer/autoload_real.php): failed to
open stream: No such file or directory in /hsphere/local/home/livenoma/
writemorefaster.com/vendor/autoload.php on line 5 Fatal error:
require_once(): Failed opening required
'DIR/composer/autoload_real.php'
(include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php on
line 5I figured I had the wrong version of PHP, but I just checked and am
running 5.2.10. Any ideas?Here is my phpinfo: http://www.writemorefaster.com/test.php
β
Reply to this email directly or view it on GitHubhttps://github.com//issues/65
.
from pico.
Ah, that makes sense. The specs on the website need updating then, they claim Pico only requires 5.2.4+
On Monday, August 19, 2013 at 9:56 AM, Max Gfeller wrote:
You have to have PHP 5.3 installed to use the "DIR" magic constant:
http://php.net/manual/en/language.constants.predefined.phpTo preserve compability with PHP 5.2 the developers would have to replace
"DIR" withdirname(__FILE__)
2013/8/18 Chris R. Albon <[email protected] (mailto:[email protected])>
I uploaded Pico but I only see a blank php page of death. After turning on
error reporting, I get this:Notice: Use of undefined constant DIR - assumed 'DIR' in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php (http://writemorefaster.com/vendor/autoload.php) on
line 5 Warning: require_once(DIR/composer/autoload_real.php): failed to
open stream: No such file or directory in /hsphere/local/home/livenoma/
writemorefaster.com/vendor/autoload.php (http://writemorefaster.com/vendor/autoload.php) on line 5 Fatal error:
require_once(): Failed opening required
'DIR/composer/autoload_real.php'
(include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in
/hsphere/local/home/livenoma/writemorefaster.com/vendor/autoload.php (http://writemorefaster.com/vendor/autoload.php) on
line 5I figured I had the wrong version of PHP, but I just checked and am
running 5.2.10. Any ideas?Here is my phpinfo: http://www.writemorefaster.com/test.php
β
Reply to this email directly or view it on GitHubhttps://github.com//issues/65
.β
Reply to this email directly or view it on GitHub (#65 (comment)).
from pico.
But since the whole vendor directory is checked in directly in the Pico project, the end user does not need to run composer itself (which requires PHP 5.3). So if you would only update the AutoloadGenerator from composer, that would work in my opinion: https://github.com/composer/composer/blob/master/src/Composer/Autoload/AutoloadGenerator.php
So only Pico developers needed to have PHP 5.3 while the users still could use 5.2. But i don't know if the guys behind composer would merge that in.
from pico.
Is there a way to workaround the issue? My web host only has PHP version 5.2.17, and I am not a pico developer.
from pico.
You could edit the vendor/autoload.php
file manually and replace __DIR__
with dirname(__FILE__)
from pico.
Then I get
[19-Dec-2013 18:00:35] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home2/insweatc/public_html/pico/vendor/composer/autoload_real.php on line 23
[19-Dec-2013 18:00:35] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home2/insweatc/public_html/pico/vendor/composer/autoload_real.php on line 23
[19-Dec-2013 18:00:35] PHP Parse error: syntax error, unexpected T_STRING in /home2/insweatc/public_html/pico/vendor/composer/autoload_real.php on line 23
and my autoload_real.php looks like this:
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit68d29614b81b64051229769b084d96b6
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit68d29614b81b64051229769b084d96b6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit68d29614b81b64051229769b084d96b6', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register(true);
return $loader;
}
}
Any idea?
from pico.
I just found PHP 5.3 could be enabled on my host, and it is no longer an issue for me. Thanks all the same!
from pico.
Did anyone figure out how to get pico running on PHP 5.2?
I'd love to set pico up on our NAS. But an update to php 5.3 is available for that old box, sadly.
Already tried using MaxGfellers tip - get the Unexpected character in input warning like abely.
from pico.
@jduerr FYI in case anyone else has this problem. I was having a problem with this with Dokuwiki, and found my way here. To fix that I just installed an older version of Dokuwiki. That same fix might work with Pico.
from pico.
running "composer update" command worked for me.(windows)
from pico.
It's kinda weird that this Issue is actually the first Google result for this error message, even though Pico users won't experience it. Anyway, it's nevertheless a good idea to help all non-Pico users who seek help.
Welcome to the GitHub repository of Pico, a stupidly simple, blazing fast, flat file CMS. Even though you're here by chance, we might offer you a great alternative. Visit us at http://picocms.org/ and see http://picocms.org/about/ for more info. π
Depending on the actual error message you experience, the solution differs:
Notice: Use of undefined constant DIR - assumed 'DIR' in /var/www/html/β¦
Unfortunately I've to tell you that you can't run this application on your webserver π To be more presice, you shouldn't run any application on your webserver. Your webserver runs a desperately outdated version of PHP (PHP 5.2 or earlier) that didn't receive any security updates since January 2011:exclamation:
Naturally nobody can't prevent you from doing it anyway. What will prevent you from doing it is the fact, that the application you're trying to install won't run on this outdated version of PHP and requires a newer PHP version. You will likely find the required PHP version in the application's README.md
or install instructions.
There's no other solution than updating your PHP version.
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/β¦
Please check your application's install instructions (maybe in its README.md
), it looks like just uploading all of the application's files to your webserver isn't enough and you've to go through some more steps. Likely you'll have to open a shell, navigate to the desired install directory of the application and run composer install
.
However, you really should check the application's install instructions π
Cannot find 'vendor/autoload.php'. Run `composer install`.
It looks like you're a Pico user and got lost π You likely downloaded a Source code archive instead of one of Pico's release archives by accident. Just refer to Pico's install instructions and download the pico-release-[version].tar.gz
archive instead of one of the Source code
archives.
If Pico won't run nevertheless, you can join us on #picocms on Libera.Chat to get help. Alternatively, please donβt hesitate to create a new Issue on GitHub. Also see the "Getting help" section in Pico's docs.
from pico.
Related Issues (20)
- Pico 3.0: Param 'date_format' from config.yml.template leads to PHP Fatal Error HOT 2
- Reverse case sensitive declaration of meta attributes is confusing HOT 5
- Twig 2.x and YAML 3.x not supported HOT 3
- Visit counter HOT 24
- Reading Time HOT 2
- Best way to add script inside <head> HOT 4
- picocms.org is down right now HOT 3
- Nice Date filter HOT 3
- pre-bundled release: Getting "HTTP ERROR 500" HOT 7
- Support for Twig extensions? HOT 3
- cookbook issue HOT 8
- [draft ] Autoload extra stuff HOT 5
- [PLUGIN] XMPP: Post to PubSub [NOT CLOSED YET] HOT 6
- Probably a wrong logical operator HOT 2
- Question: How to use page yaml-header meta-data in php for a plugin? HOT 4
- weird display of date HOT 7
- simple comment system HOT 7
- PHP pages depth & offset HOT 2
- Pico Edit says "unmaintained - archived", HOT 2
- Pico project throwing an error template. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pico.