Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problem #18

Closed
Goodoh opened this issue Oct 13, 2013 · 9 comments
Closed

Installation problem #18

Goodoh opened this issue Oct 13, 2013 · 9 comments

Comments

@Goodoh
Copy link

Goodoh commented Oct 13, 2013

I have raised this problem before.
I have in a test file.

I'm getting error undefined function
Is it something to do with the path.
I also have a script folder and in there I have a file myscript.js.
An external javascript.

<script src="script/myscript.js"></script>

That does not work but does if not in the script folder.
I don't understand why as it should but reading in forum I saw where and to the point
lib
Add ImageWorkshop.php in lib you now have lib/ImageWorkshop.php
Images folder give 777 rights to allow the script to create images inside.

_ _ DIR _ _.'/resources/image.jpg',)); is that the way to go
@Goodoh
Copy link
Author

Goodoh commented Oct 16, 2013

In the example above I have made syntax errors but not the case in the file where I'm trying.
I don't understand why it is not working.I get namespace must come first or undefined function . I have un commented all the require_once in the files in PHPImageWorkshop.

@Sybio
Copy link
Owner

Sybio commented Oct 16, 2013

If you paste code with syntax error, I can't help and see the right error ! Can you zip me your projet and upload it somewhere I can download it and take a look ?

@Goodoh
Copy link
Author

Goodoh commented Oct 17, 2013

You have to forgive me as I am a learner and don't like wasting your time asking questions.
To be honest I'm not sure where to upload or what, exactly, to upload , however I'll explain.
I have xampp installed in a folder I have named apache.
In htdocs I have the root directory which I have named website.In the website folder I have
Folders:images1, images2,lib,resources,scripts,storeadmin,styles.
Files:index.php,product.php,test.php.
I have other files that are ready for use but first I want to get ImageWorkshop working and adjust those files.
Index.php will be the home page.
What I am doing is using test.php for ImageWorkshop as in testing.
lib folder has PHPImageWorkshop in it.
image1 has images in there that are ready for adjusting so to speak.
image2 will be used for the final image that has been worked on with ImageWorkshop.
resources has one image in ready to test out Imageworkshop.
storeadmin is empty.
styles has style files in there and no problem accessing them.
scripts I have myscript.js in there and jquery-1.10.1.js
myscript.js is not working in scripts folder and not if it is in website as I just tested and only works if in the php file itelf. Have to have the script in the file.
So really I am only using at this time lib folder and test.php and resources folder is ready with an image as is images2 for the final image to go in.
In test.php.

or if I put in line 4 (class_exists('PHPImageWorkshop\ImageWorkshop'));
I get this
fatal error Namespace declaration statement has to be the very first statement in the script
C:\apache\htdocs\website\lib\PHPImageWorkshop\ImageWorkshop.php on line 3
I have tested the the file ImageWorkshop.php exists and the image in resources and have got an output of test when

I'm not getting past line 3
I hope I have explained it well for you and appreciate your response.Thanks for that.
Goodoh

@Sybio
Copy link
Owner

Sybio commented Oct 17, 2013

fatal error Namespace declaration statement has to be the very first statement in the script
C:\apache\htdocs\website\lib\PHPImageWorkshop\ImageWorkshop.php on line 3

In ImageWorkshop.php file, it seems you place code before namespace statement.

Please verify this file ("lib/PHPImageWorkshop/ImageWorkshop.php"), it has to begin like that :

<?php

namespace PHPImageWorkshop;

use PHPImageWorkshop\Core\ImageWorkshopLayer as ImageWorkshopLayer;
use PHPImageWorkshop\Core\ImageWorkshopLib as ImageWorkshopLib;
use PHPImageWorkshop\Exception\ImageWorkshopException as ImageWorkshopException;

// If no autoloader, uncomment these lines:
require_once(__DIR__.'/Core/ImageWorkshopLayer.php');
require_once(__DIR__.'/Exception/ImageWorkshopException.php');

Check that there is nothing before "namespace PHPImageWorkshop;" and then "use PHPImageWorkshop...".

@Goodoh
Copy link
Author

Goodoh commented Oct 18, 2013

I have checked ImageWorkshop.php and is as it should be. Nothing before namespace and the required_once uncommented.
Then I have checked ImageWorkshop.php, the file exists and got true.
Then I did this.

got
Phase error syntax error unexpected';' in C:\apache\htdocs\website\test.php on line 4
Then I did line 4 as this
var_dump(class_exists('ImageWorkshop');
and got the same Phase error as above.
Isn't that strange as a different error as from before and yet nothing different.
I only looked at ImageWorkshop.php as it was as you have pointed out.

@Goodoh
Copy link
Author

Goodoh commented Oct 18, 2013

Sorry I only just realized just as I sent the last comment the syntax error as in line 4
The ) var_dump(class_exists('ImageWorkshop'));
and in correcting that I got the error as before namespace declaration statement has to be the very first statement in the script.

@Sybio
Copy link
Owner

Sybio commented Oct 20, 2013

Ok but PHP think there is something before the namespace declaration of ImageWorkshop.php. This perhaps a problem of file encoding. Check the encoding of test.php, it must be UTF-8 without BOM, the same for the lib files.

Is there a way you can paste your project code here for example : http://pastebin.com/, I'll test it in my PHP environment.

@Goodoh
Copy link
Author

Goodoh commented Oct 21, 2013

Hello,
I was thinking as in what part of the project do you need as I have file
that I'm still working on. Images are already compressed and do you need
them. I'm a learner as you know and it does get a little confusing for me.
On to a point of similar concern.
My connect to sql file.

// got an error to start that said mysql depreciated and to use mysqli and
that is how I have it.
Anyway I'm now getting an error select _db must have two parameters, so i
tried and added $db_host and error
must have one parameter. So back and forth from 1 to 2 in trial and error.
With that I could have a problem with privileges yet is that separate to
this issue, if that is another issue(privileges).
Earlier I had trouble with an external .js file.in a folder called scripts.
But now there is not a problem as I have this external javascript file in
the folder and am accessing it.
By <script src="scripts/myscript.js"></script>
It could have been syntax errors but I fairly sure after looking into such
a thing, it was not the case.
Anyway it is working.
Can you please give me an idea as to what files you'd need and not needed.
Example images as that is basic I would think
and not needed.
Files like test.php and other files for sotreadmin and scripts such as
connect to sql in storescripts.
What about pages for the site which are still being worked on such as some
with the images I intend to adjust etc.
Thanks and I hope I have not confused you yet I think you have an
understanding of such things and would follow what I;m saying
Thanks Goodoh

On Mon, Oct 21, 2013 at 12:18 AM, Clément Guillemain <
notifications@github.com> wrote:

Ok but PHP think there is something before the namespace declaration of
ImageWorkshop.php. This perhaps a problem of file encoding. Check the
encoding of test.php, it must be UTF-8 without BOM, the same for the lib
files.

Is there a way you can paste your project code here for example :
http://pastebin.com/, I'll test it in my PHP environment.


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-26673833
.

@Sybio
Copy link
Owner

Sybio commented Nov 25, 2013

Solved #28

@Sybio Sybio closed this as completed Nov 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants