I'm using a Drupal module called 'Code Per Node'. It allows basically what the name describes: custom code in the form of JS or CSS on a per node basis. Upon publishing the node, the module writes the css and js to a file specified in the module's configuration settings.
In development, I have the directory set to /cpn, I've temporarily made the permissions for that folder 0777 just to cover all angles.
The problem is, I've moved the site to a staging server and something about the environment is restricting the module from writing the CSS and JS files. it returns a 'The file could not be created' error upon publishing.
I've tried: Setting open permissions and moving directory inside of /sites/default, no dice.
Is there anything else I should look at that would prevent this module from writing these files? Perhaps an Apache config setting?
As a side note, I would much prefer the custom code be generated inline on the page, so if anyone knows any actively supported modules that accomplish this, that would also be much appreciated.
Thanks
Problem was that the tmp directory for Drupal was still set to a local path.
Related
New to php with VisualStudioCode, i'm searching a method (settings, extensions, ...) to add a path to include php library, for code completion only.
Let's say, for the example, that I'm working on a wordpress plugin.
My VSC working directory is /Users/richnou/Documents/my-wp-plugin/ which contains only the plugins files (php, sass, css, gitignore, etc...) ; they are automatically sent to a development server.
With this configuration, all the core Wordpress functions are Undefined function (I have PHP IntelliSense and PHP Intelephense installed).
There is a way to specify folders that will be scanned for code completion and hints ? So, one Wordpress Code installed in a common directory (say, /Users/richnou/Documents/wordpress/ for ex.), so outside of my directory. (Netbeans has this "include path" notion...)
Thank's in advance
Problem here is that Documents folder is secured, so put plugin file on path /Users/richnou/
Solved my problem
One solution (not ideal but which works) is to go through a symbolic link to a local installation of Wordpress...
ln -s /Users/richnou/Documents/wordpress/ wp
My page in wordpress have a button like "Go to the next".
I am trying to get my php file run by clicking the button.
<form action="https://"domain name".com/hoge.php" method="POST"></form>
The php file is successfully run if I locate the php file in the domain.
(like, https://"domain name".com/hoge.php)
However, the php file can not be run if I locate the file in the themes folder, and the response is 404 not found.
(like, https://"domain name".com/public_html/wp-content/themes/hoge.php)
So I have 2 questions.
Why the php file can not be accessed if I locate the file in the themes folder?
Talking about security, is it safe to locate my php file in the domain directly?
(like, https://"domain name".com/hoge.php)
wp-content implies this is a WordPress Site.
Wordpress changes the .htaccess to prevent exactly this. The htaccess will not let you access the sub php files directly.
Answer for question 1:
There has a lot factor affecting to located your file. It might involved to the RewriteRule for .htaccess configuration, your platform configuration or just you create file at wrong location or wrong name
Answer for question 2:
Yes, it is unsafe, because it can be access by anyone else. So you need to perform some authenticate checking before execute the written code, for example use SESSION to check the user is already logged in before execute your code.
Your way of handling FORM is perfectly ok, while developing in core PHP. But, WordPress has its own handling FORM. YOu can check out this blog on how to handle the FORM in WordPress way.
Something wrong with my assets configuration, it looks to /usr/lib/cgi-bin/assets, which is wrong I guess. How to fix it?
Yii setup is initial.
Apache config:
Nginx config:
I recently also had similar problem with missing folder assets (I don't know how that happened since I have installed Yii2 multiple times and that occurred just once). The difference was only different path to it.
What solved my issue is creation of that folder in specified path (which is /usr/lib/cgi-bin in your case and it should be an empty folder, no need to write anything in it).
After that, Yii2 system should generate all widgets' JavaScript and CSS files automatically (assuming your server allows that). Try to access the website and if you still have the same issue (which shouldn't be the case anymore?), check if there are any files/folders in your newly created assets folder.
I have been having trouble with writing an uploaded file into a pretty vanilla Drupal 7.27
install.
What I want to do is use tinymce and the really quite nifty file browser lioniteimages with it. I am using the wysiwyg module though I have modified it to accept the lioniteimages package (minimally- just listing it so it works really)
Sadly, when I use lioniteimages, it fails at the upload stage, returning a 'directory is not writable' error.
Poking around in the PHP code shows this results from a FALSE flag from the PHP is_writable() call in the upload script. I have confirmed it is checking the expected directory. I have tried adding an is_readable call to test the same directory and this too returns FALSE so I suspect an apache issue or .htaccess here.
I have tried setting the relevant folder permissions to 755 and 777 without success.
I can upload files into the folder using cute FTP
I have tried adding .htaccess in the image upload directory:
order allow,deny
allow from all
And all without success. It is possible to see the permissions correctly set to 777.
I get a 403 error if I try to access the /images directory in my browser with or without the .htaccess though the Drupal .htaccess removes auto directory listing.
Any assistance would be very much appreciated. Sorry there is no actual code to share - this is a configuration question really but I am stuck as to where to go from here.
The directory structure is:
/public_html/site/sites/all/images
/public_html/site/sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/lioniteimages/connector/php
I have also tried deleting and re-installing the Drupal instance with only the wysiwyg module installed and the problem does not go away. Deleting the drupal .htaccess does not help either.
I updated a Joomla website for a customer of mine. I did this in XAMPP. Now, when transferring it to the server, I have some problems. I can't install extensions anymore and I get the message:
JFolder::create: Infinite loop detected
Warning: Failed to move file!
After some reading I found out it's possibly caused by the log and tmp folder, but I don't know how to rename them to work. (The link to them in the config.php file)
public_html > tmp / log (both tmp and log are in the main directory of public_html)
How would I set them up to work? And is it definitely this that is causing this error?
You can actually edit those values using Joomla's back-end. Go to global configuration settings menu option, one of the text fields is in the Server tab and the other is in the System tab. If you can, put the full directory path of the server in for the values.