Jump to content

Problems installing PW


kolkalo
 Share

Recommended Posts

Hey y'all!

I have a few leftovers from a bit of HTML coding I've done 20 years ago, but -curiously- I'm having a hard time with PW, PHP, etc.

The endgoal is to have a website to help me with teaching classes. I'm following in the steps of a friend who developped https://planetalert.ouvaton.org/ .

I have a domain name through lautre.net, a great collective from here in France. I uploaded PW files through the installer ZIP as well as cloning the git, using Filezilla.

After some problems concerning PHP version (resolved) and a few more concerning the htaccess file, I have determined some lines posing problem in this file and modified it as follows : 
 

# 1. Apache Options 
#[...]
# Do not use multiviews (v301)
# Options -MultiViews ///error 500

# Do follow symbolic links (commented the first one to test)
 Options +FollowSymLinks
# Options +SymLinksifOwnerMatch ///error 500
#[...]
  # 8A. Optionally (O) set a rewrite base if rewrites are not working properly on your server.
  #[...]
  # Examples of RewriteBase (root and subdirectories): 
   RewriteBase /
   RewriteBase /pw/
   RewriteBase /~user/

Then the installer didn't show me the admin parameters but stopped at the database saving, so I modified install.php to turn TEST_MODE on, which allowed me to see that it was skipping the part creating the admin login.

Anyway I can't get through to create an admin login and use the tool. After that, trying to go further sends back 500 error.

When trying to acces the folder containing the install.php file, it sends back :


Home
Homepage content

Arrgh Fatal Error: Uncaught Error: Call to undefined function chmod() in wire/core/WireFileTools.php:215

#0 wire/core/FileCompiler.php (231): WireFileTools->chmod()
#1 wire/core/FileCompiler.php (1077): FileCompiler->chmod()
#2 wire/core/ProcessWire.php (835): FileCompiler->maintenance()
#3 wire/core/Wire.php (416): ProcessWire->___finished()
#4 wire/core/WireHooks.php (968): Wire->_callMethod()
#5 wire/core/Wire.php (484): WireHooks->runHooks()
#6 wire/core/ProcessWire.php (912): Wire->__call()
#7 wire/core/ProcessWire.php (684): ProcessWire->__call()
#8 wire/modules/Process/ProcessPageView.module (530): ProcessWire->setStatus()
#9 wire/core/Wire.php (413): ProcessPageView->___finished()
#10 wire/core/WireHooks.php (968): Wire->_callMethod()
#11 wire/core/Wire.php (484): WireHooks->runHooks()
#12 index.php (56): Wire->__call()
#13 {main}
thrown (line 215 of wire/core/WireFileTools.php)

This error message was shown because: site is in debug mode. ($config->debug = true; => site/config.php). Error has been logged.

Before trying on TEST_MODE and trying to access this folder : 


Warning: touch(): Unable to create file /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/site/assets/cache/WireCache.maint because No such file or directory in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireCache.php on line 876

Fatal error: Uncaught Error: Call to undefined function ProcessWire\chmod() in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireFileTools.php:201 Stack trace: #0 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireFileTools.php(80): ProcessWire\WireFileTools->chmod() #1 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/FileLog.php(754): ProcessWire\WireFileTools->mkdir() #2 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/FileLog.php(110): ProcessWire\FileLog->path() #3 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Wire.php(1676): ProcessWire\FileLog->wired() #4 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Wire.php(1787): ProcessWire\Wire->setWire() #5 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireLog.php(578): ProcessWire\Wire->wire() #6 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireLog.php(135): ProcessWire\WireLog->getFileLog() #7 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Wire.php(422): ProcessWire\WireLog->___save() #8 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod() #9 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks() #10 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/modules/System/SystemUpdater/SystemUpdater.module(371): ProcessWire\Wire->__call() #11 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/modules/System/SystemUpdater/SystemUpdater.module(330): ProcessWire\SystemUpdater->log() #12 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/modules/System/SystemUpdater/SystemUpdate.php(60): ProcessWire\SystemUpdater->message() #13 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/modules/System/SystemUpdater/SystemUpdater.module(217): ProcessWire\SystemUpdate->message() #14 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/modules/System/SystemUpdater/SystemUpdater.module(98): ProcessWire\SystemUpdater->update() #15 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/ModulesLoader.php(168): ProcessWire\SystemUpdater->init() #16 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Modules.php(625): ProcessWire\ModulesLoader->initModule() #17 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/Modules.php(453): ProcessWire\Modules->getModule() #18 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/ProcessWire.php(565): ProcessWire\Modules->get() #19 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/ProcessWire.php(316): ProcessWire\ProcessWire->load() #20 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/index.php(52): ProcessWire\ProcessWire->__construct() #21 {main} thrown in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireFileTools.php on line 201

Fatal error: Uncaught Error: Call to undefined function ProcessWire\chmod() in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireFileTools.php:215 Stack trace: #0 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/FileLog.php(237): ProcessWire\WireFileTools->chmod() #1 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireShutdown.php(658): ProcessWire\FileLog->save() #2 /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireShutdown.php(562): ProcessWire\WireShutdown->saveFatalLog() #3 [internal function]: ProcessWire\WireShutdown->shutdown() #4 {main} thrown in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireFileTools.php on line 215

When, with TEST_MODE on, I enter my admin data :



Warning: touch(): Unable to create file /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/site/assets/cache/WireCache.maint because No such file or directory in /var/www/alternc/r/rhino6ros/www/rhino6ros.lautre.net/1/processwire-master/wire/core/WireCache.php on line 876

What the Fatal Error: Uncaught Error: Call to undefined function chmod() in wire/core/WireFileTools.php:215

#0 wire/core/FileLog.php (237): WireFileTools->chmod()
#1 wire/core/WireLog.php (175): FileLog->save()
#2 wire/core/Wire.php (422): WireLog->___save()
#3 wire/core/WireHooks.php (968): Wire->_callMethod()
#4 wire/core/Wire.php (484): WireHooks->runHooks()
#5 wire/modules/System/SystemUpdater/SystemUpdater.module (371): Wire->__call()
#6 wire/modules/System/SystemUpdater/SystemUpdater.module (330): SystemUpdater->log()
#7 wire/modules/System/SystemUpdater/SystemUpdate.php (60): SystemUpdater->message()
#8 wire/modules/System/SystemUpdater/SystemUpdater.module (217): SystemUpdate->message()
#9 wire/modules/System/SystemUpdater/SystemUpdater.module (98): SystemUpdater->update()
#10 wire/core/ModulesLoader.php (168): SystemUpdater->init()
#11 wire/core/Modules.php (625): ModulesLoader->initModule()
#12 wire/core/Modules.php (453): Modules->getModule()
#13 wire/core/ProcessWire.php (565): Modules->get()
#14 wire/core/ProcessWire.php (316): ProcessWire->load()
#15 index.php (52): ProcessWire->__construct()
#16 install.php (103): require('...')
#17 install.php (2066): Installer->execute()
#18 {main}
thrown (line 215 of wire/core/WireFileTools.php)

the line 215 of WireFileTools is indicated here with **** :


	/**
	 * Change the read/write mode of a file or directory, consistent with ProcessWire's configuration settings
	 * 
	 * Unless a specific mode is provided via the `$chmod` argument, this method uses the `$config->chmodDir`
	 * and `$config->chmodFile` settings in /site/config.php. 
	 * 
	 * This method also provides the option of going recursive, adjusting the read/write mode for an entire
	 * file/directory tree at once. 
	 * 
	 * The `$recursive` or `$chmod` arguments may be optionally swapped in order (since 3.0.34).
	 * 
	 * ~~~~~
	 * // Update the mode of /site/assets/cache/foo-bar/ recursively
	 * $files->chmod($config->paths->cache . 'foo-bar/', true); 
	 * ~~~~~
	 * 
	 * #pw-group-manipulation
	 * 
	 * @param string $path Path or file that you want to adjust mode for (may be a path/directory or a filename).
	 * @param bool|string $recursive If set to true, all files and directories in $path will be recursively set as well (default=false). 
	 * @param string|null|bool $chmod If you want to set the mode to something other than ProcessWire's chmodFile/chmodDir settings,
	 * you may override it by specifying it here. Ignored otherwise. Format should be a string, like "0755".
	 * @return bool Returns true if all changes were successful, or false if at least one chmod failed.
	 * @throws WireException when it receives incorrect chmod format
	 *
	 */
	public function chmod($path, $recursive = false, $chmod = null) {
		
		if(is_string($recursive) && strlen($recursive) > 2) {
			// chmod argument specified as $recursive argument or arguments swapped
			$_chmod = $recursive;
			$recursive = is_bool($chmod) ? $chmod : false;
			$chmod = $_chmod; 
		}

		if(is_null($chmod)) {
			// default: pull values from PW config
			$chmodFile = $this->wire()->config->chmodFile;
			$chmodDir = $this->wire()->config->chmodDir;
		} else {
			// optional, manually specified string
			if(!is_string($chmod)) {
				$this->filesException(__FUNCTION__, "chmod must be specified as a string like '0755'");
			}
			$chmodFile = $chmod;
			$chmodDir = $chmod;
		}

		$numFails = 0;

		if(is_dir($path)) {
			// $path is a directory
			if($chmodDir) if(!@chmod($path, octdec($chmodDir))) $numFails++;

			// change mode of files in directory, if recursive
			if($recursive) foreach(new \DirectoryIterator($path) as $file) {
				if($file->isDot()) continue;
				$mod = $file->isDir() ? $chmodDir : $chmodFile;
				if($mod) if(!@chmod($file->getPathname(), octdec($mod))) $numFails++;
				if($file->isDir()) {
					if(!$this->chmod($file->getPathname(), true, $chmod)) $numFails++;
				}
			}
		} else {
			// $path is a file
			$mod = $chmodFile;
***			if($mod) if(!@chmod($path, octdec($mod))) $numFails++;
		}

		return $numFails == 0;
	}

TL;DR : no good. Don't understand.

 

Thanks in advance for any help, it is greatly appreciated ! 😄

 

Kolkalo

Link to comment
Share on other sites

Have you tried to upload a clean fresh PW installation with a basic or blank profile first or did you try to upload an older existing PW site? Have you followed those steps https://processwire.com/docs/start/install/? Sounds like a file/folder permission issue for me or maybe an broken upload with your FTP tool. Some infos about file permissions can be found in the tutorial section too https://processwire.com/docs/security/file-permissions/.

Edited by cwsoft
Link to comment
Share on other sites

Hey! Yeah I have tried about 4 or 5 fresh installations, and I did not mention it before but I was intending to try the blank profile first... I tried the steps you mentioned and then some to help with every stumbling step ^^'

Link to comment
Share on other sites

I'm curious about the permissions you mention, because as the install does not go right, how am I to access these files as a superuser? especially as it fails during the admin setup... should I grant all permissions to all for the time of the install?

Link to comment
Share on other sites

22 minutes ago, cwsoft said:

Sounds like a file/folder permission issue for me or maybe an broken upload with your FTP tool

got this feel too! better if you can zip and unzip on server.

Link to comment
Share on other sites

7 hours ago, celfred said:

… Is this because of some sort of security issue ? Is there a way to activate this for a particular user ? I'm just being curious…

You need to contact your ISP to sort out if there is a way to set the required file/folder permissions the way required to setup PW on your shared host environment. Maybe read this tutorial on securing file permissions too https://processwire.com/docs/security/file-permissions/

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...