This might be a dummy question now but bevertheless giving it a try: I am just trying to setup scssphp in my cakephp 4 but seem to have a knot in my head. Can anymone shed some light on what I need to do to get it running?
My simple idea was to just include the code below into the app controller initialize function
<?php
require "scssphp/scss.inc.php";
$scss = new scssc();
$scss->setImportPaths("stylesheets/");
// will search for `stylesheets/style.scss'
echo $scss->compile('#import "style.scss"');
And I create the "scssphp" folder structure with the "scss.inc.php" right under webroot:
webroot/scssphp/scss.inc.php
webroot/scssphp/style.php
webroot/scssphp/stylesheets/style.scss
But then I get
Warning (2): require(/scssphp/scss.inc.php): failed to open stream: No such file or directory [APP/Controller/AppController.php, line 84]
Warning (2): require(/scssphp/scss.inc.php) [<a href='https://secure.php.net/function.require'>function.require</a>]: failed to open stream: No such file or directory [APP/Controller/AppController.php, line 84]
Fatal error: require() [function.require]: Failed opening required '/scssphp/scss.inc.php' (include_path='.:/usr/local/lib/php') in /somepath/myapp.com/dev/src/Controller/AppController.php on line 84
Any help is greatly appreciated!
Update: this article describes how to include external classes quite well and helped me in a first step to solve the issue describe above: How can I use my own external class in CakePHP 3.0?
Related
I have very basic knowledge of coding, I took a copy of our company's website to practice making changes to it.
But when I try to run it I get this error
Warning: require_once(/var/www/html/classes/database_class_pdo.php):
failed to open stream: No such file or directory in
D:\xampp\htdocs\HJ\top.php on line 10
Fatal error: require_once(): Failed opening required
'/var/www/html/classes/database_class_pdo.php'
(include_path='D:\xampp\php\PEAR') in D:\xampp\htdocs\HJ\top.php on
line 10
Please, can someone tell me the issue here?
Thank you.
It's because your php file is trying to open a file named /var/www/html/classes/database_class_pdo.php but cannot find it. Try to see if the path is correct or if the file exists.
I have a PHP project with the following structure:
Project structure
I'm getting this an error that says:
Warning: require(../app/view/home.php): failed to open stream: No such file or directory in /opt/app-root/src/index.php on line 22
Fatal error: require(): Failed opening required '../app/view/home.php' (include_path='.:/opt/app-root/src:/opt/rh/rh-php70/root/usr/share/pear') in /opt/app-root/src/index.php on line 22
Can anyone help me to resolve this issue?
Update:
Project structure on Openshift
Thanks in advance.
I see in you image of your folder structure you have folders for public and app containing the code, but the errors from your deployment look like the code is no longer in public public but in src.. are you sure the relative links are still correctly configured?
Has index.php maybe moved to the root and the link to ../abc/xyz.php should be updated to abc/xyz.php?
I am trying to make a login system for my app, and needed to use php for it. However I'm really new to php so I got errors. First of all, I am using a free web hosting for now, so it might be the issue here. That being said, here is the error part of my php:
<?php
require_once 'include/DB_Functions.php';
?>
And it gives me this error:
Warning: require_once(include/DB_Functions.php): failed to open stream: No such file or directory in /srv/disk3/1965965/www/yigittest.atwebpages.com/login.php on line 2
Fatal error: require_once(): Failed opening required 'include/DB_Functions.php' (include_path='.:/usr/local/php-5.4.45/share/pear') in /srv/disk3/1965965/www/yigittest.atwebpages.com/login.php on line 2
However, my include folder contains all the required php files. So what might be the issue here?
Try this demo code or plz share your folder structure
require_once(__DIR__.'/../include/DB_Functions.php');
Were currently trying to host an existing website on a new local server. I'm quite new to zend but have some experience in php.
this is the error code i get
Warning: require_once(../../Statement/Pdo.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/Hg/Zend/Db/Adapter/Pdo/Abstract.php on line 33
Fatal error: require_once(): Failed opening required '../../Statement/Pdo.php' (include_path='.:/Applications/MAMP/bin/php/php5.5.26/lib/php') in /Applications/MAMP/htdocs/Hg/Zend/Db/Adapter/Pdo/Abstract.php on line 33
The pdo.php file links up fine in phpstorm. I haven't a clue whats up with this now.
Any help would be greatful
Cheers!
I have encountered a problem that I have not come accross yet when setting up a log in page using php.
The page has a error message that relates to line 1 ( require_once('../Connections/Login.php)
that states
[function.require-once]: failed to open stream: No such file or directory
Fatal Error: require_once() [function.require]: failed opening required ... (include_path='.:/usr/share/pear-php5')
I know it is probably really simple and stupid, but I'm really struggling to self-troubleshoot and would really value some help please?
This is where I have been so confused. I also thought the same, that it just couldn't find the file; however the structure is just as you have said:
htdocs/comparison.php (the log in page)
htdocs/Connections/connComparisonLogin.php
Sorry this is going to confuse you, I simplified the actual script in my original question and here is the actual error message:
Warning: require_once(../Connections/connComparisonLogin.php) [function.require-once]: failed to open stream: No such file or directory in /home/fhlinux135/s/suzukigenuine.com/user/htdocs/comparison.php on line 1
Fatal error: require_once() [function.require]: Failed opening required '../Connections/connComparisonLogin.php' (include_path='.:/usr/share/pear-php5') in /home/fhlinux135/s/suzukigenuine.com/user/htdocs/comparison.php on line 1
Have I done it all wrong?
I think your require statement should be:
require_once 'Connections/connComparisonLogin.php';
Where is your "Connections/Login.php" relative to the currrent php file.
php will look for the file relative to the current file, or, in one of the directories specified in the "include_path" php.ini setting.
The error just means php can't find the Login.php file. Assuming the page you are calling is index.php you should have a director structure like
-Dir1
|-index.php
-Connections
|-Login.php
Why are you going up a directory in your require statement? Remove the "../" from the beginning of your require_once path.